scilab: group together STL container typemaps tests (associative + sequence) in same test
This commit is contained in:
parent
4edea13385
commit
e87fce527e
5 changed files with 134 additions and 257 deletions
|
|
@ -6,10 +6,14 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
@ -48,8 +52,8 @@ namespace std {
|
||||||
|
|
||||||
static SeqCont ret_container(const value_type value1, const value_type value2) {
|
static SeqCont ret_container(const value_type value1, const value_type value2) {
|
||||||
SeqCont s;
|
SeqCont s;
|
||||||
s.push_back(value1);
|
s.insert(s.end(), value1);
|
||||||
s.push_back(value2);
|
s.insert(s.end(), value2);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,43 +68,17 @@ namespace std {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T, class Container>
|
||||||
std::vector<T> ret_vector(const T value1, const T value2) {
|
Container ret_container(const T value1, const T value2) {
|
||||||
return sequence_container<std::vector<T> >::ret_container(value1, value2);
|
return sequence_container<Container>::ret_container(value1, value2);
|
||||||
}
|
}
|
||||||
template<typename T>
|
template<typename T, class Container>
|
||||||
T val_vector(const std::vector<T> container) {
|
T val_container(const Container container) {
|
||||||
return sequence_container<std::vector<T> >::val_container(container);
|
return sequence_container<Container >::val_container(container);
|
||||||
}
|
}
|
||||||
template<typename T>
|
template<typename T, class Container>
|
||||||
T ref_vector(const std::vector<T>& container) {
|
T ref_container(const Container& container) {
|
||||||
return sequence_container<std::vector<T> >::ref_container(container);
|
return sequence_container<Container >::ref_container(container);
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
std::list<T> ret_list(const T value1, const T value2) {
|
|
||||||
return sequence_container<std::list<T> >::ret_container(value1, value2);
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
T val_list(const std::list<T> container) {
|
|
||||||
return sequence_container<std::list<T> >::val_container(container);
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
T ref_list(const std::list<T>& container) {
|
|
||||||
return sequence_container<std::list<T> >::ref_container(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
std::deque<T> ret_deque(const T value1, const T value2) {
|
|
||||||
return sequence_container<std::deque<T> >::ret_container(value1, value2);
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
T val_deque(const std::deque<T> container) {
|
|
||||||
return sequence_container<std::deque<T> >::val_container(container);
|
|
||||||
}
|
|
||||||
template<typename T>
|
|
||||||
T ref_deque(const std::deque<T>& container) {
|
|
||||||
return sequence_container<std::deque<T> >::ref_container(container);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
@ -111,21 +89,26 @@ namespace std
|
||||||
%template(TYPE ## _vector) std::vector<TYPE>;
|
%template(TYPE ## _vector) std::vector<TYPE>;
|
||||||
%template(TYPE ## _list) std::list<TYPE>;
|
%template(TYPE ## _list) std::list<TYPE>;
|
||||||
%template(TYPE ## _deque) std::deque<TYPE>;
|
%template(TYPE ## _deque) std::deque<TYPE>;
|
||||||
|
%template(TYPE ## _set) std::set<TYPE>;
|
||||||
}
|
}
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
||||||
%define instantiate_containers_functions(TYPE...)
|
%define instantiate_containers_functions(TYPE...)
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
%template(ret_ ## TYPE ## _vector) ret_vector<TYPE>;
|
%template(ret_ ## TYPE ## _vector) ret_container<TYPE, std::vector<TYPE> >;
|
||||||
%template(val_ ## TYPE ## _vector) val_vector<TYPE>;
|
%template(val_ ## TYPE ## _vector) val_container<TYPE, std::vector<TYPE> >;
|
||||||
%template(ref_ ## TYPE ## _vector) ref_vector<TYPE>;
|
%template(ref_ ## TYPE ## _vector) ref_container<TYPE, std::vector<TYPE> >;
|
||||||
%template(ret_ ## TYPE ## _list) ret_list<TYPE>;
|
%template(ret_ ## TYPE ## _list) ret_container<TYPE, std::list<TYPE> >;
|
||||||
%template(val_ ## TYPE ## _list) val_list<TYPE>;
|
%template(val_ ## TYPE ## _list) val_container<TYPE, std::list<TYPE> >;
|
||||||
%template(ref_ ## TYPE ## _list) ref_list<TYPE>;
|
%template(ref_ ## TYPE ## _list) ref_container<TYPE, std::list<TYPE> >;
|
||||||
%template(ret_ ## TYPE ## _deque) ret_deque<TYPE>;
|
%template(ret_ ## TYPE ## _deque) ret_container<TYPE, std::deque<TYPE> >;
|
||||||
%template(val_ ## TYPE ## _deque) val_deque<TYPE>;
|
%template(val_ ## TYPE ## _deque) val_container<TYPE, std::deque<TYPE> >;
|
||||||
%template(ref_ ## TYPE ## _deque) ref_deque<TYPE>;
|
%template(ref_ ## TYPE ## _deque) ref_container<TYPE, std::deque<TYPE> >;
|
||||||
|
%template(ret_ ## TYPE ## _set) ret_container<TYPE, std::set<TYPE> >;
|
||||||
|
%template(val_ ## TYPE ## _set) val_container<TYPE, std::set<TYPE> >;
|
||||||
|
%template(ref_ ## TYPE ## _set) ref_container<TYPE, std::set<TYPE> >;
|
||||||
}
|
}
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
%module li_std_set_as_argument
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <numeric>
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include stl.i
|
|
||||||
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
%template(IntSet) set<int>;
|
|
||||||
%template(StringSet) set<std::string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
%ignore concat_set;
|
|
||||||
|
|
||||||
%inline %{
|
|
||||||
template <typename T>
|
|
||||||
std::set<T> concat_set(const std::set<T> set, const std::set<T> other_set)
|
|
||||||
{
|
|
||||||
std::set<T> out_set(set);
|
|
||||||
out_set.insert(other_set.begin(), other_set.end());
|
|
||||||
return out_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
// int sets
|
|
||||||
|
|
||||||
std::set<int> create_integer_set(const int rangemin, const int rangemax)
|
|
||||||
{
|
|
||||||
std::set<int> out_set;
|
|
||||||
for (int i = rangemin; i <= rangemax; i++)
|
|
||||||
{
|
|
||||||
out_set.insert(i);
|
|
||||||
}
|
|
||||||
return out_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sum_integer_set(const std::set<int>& set)
|
|
||||||
{
|
|
||||||
return std::accumulate(set.begin(), set.end(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::set<int> concat_integer_set(const std::set<int> set, const std::set<int> other_set)
|
|
||||||
{
|
|
||||||
return concat_set<int>(set, other_set);
|
|
||||||
}
|
|
||||||
|
|
||||||
// string sets
|
|
||||||
|
|
||||||
std::set<std::string> create_string_set(const char* svalue)
|
|
||||||
{
|
|
||||||
std::set<std::string> out_set;
|
|
||||||
std::string str(svalue);
|
|
||||||
|
|
||||||
std::istringstream iss(str);
|
|
||||||
std::copy(std::istream_iterator<std::string>(iss),
|
|
||||||
std::istream_iterator<std::string>(),
|
|
||||||
std::inserter<std::set<std::string> >(out_set, out_set.begin()));
|
|
||||||
|
|
||||||
return out_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::set<std::string> concat_string_set(const std::set<std::string> set, const std::set<std::string> other_set)
|
|
||||||
{
|
|
||||||
return concat_set<std::string>(set, other_set);
|
|
||||||
}
|
|
||||||
%}
|
|
||||||
|
|
||||||
105
Examples/test-suite/scilab/li_std_container_typemaps_runme.sci
Normal file
105
Examples/test-suite/scilab/li_std_container_typemaps_runme.sci
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
// test STL containers typemaps
|
||||||
|
|
||||||
|
exec("swigtest.start", -1);
|
||||||
|
|
||||||
|
function checkerror(ierr, cmd)
|
||||||
|
if ierr <> 0 then swigtesterror("error " + string(ierr) + " in """ + cmd + """"); end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
// test container of pointers returned from fonction (expected a list)
|
||||||
|
function [classAPtr_list, classAPtr1, classAPtr2] = testCreateContainerPtr(container, value1, value2)
|
||||||
|
classAPtr1 = new_ClassA(value1);
|
||||||
|
classAPtr2 = new_ClassA(value2);
|
||||||
|
func = msprintf("ret_ClassAPtr_%s", container);
|
||||||
|
cmd = msprintf("classAPtr_list = %s(classAPtr1, classAPtr2);", func);
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
if ierr <> 0 then swigtesterror("error in " + cmd); end
|
||||||
|
if ~exists('classAPtr_list') | (size(classAPtr_list) <> 2) then
|
||||||
|
swigtesterror(func);
|
||||||
|
end
|
||||||
|
checkequal(ClassA_a_get(classAPtr_list(1)), value1, "ClassA_a_get(classAPtr_list(1))");
|
||||||
|
checkequal(ClassA_a_get(classAPtr_list(2)), value2, "ClassA_a_get(classAPtr_list(2))");
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
// test a given container of pointer
|
||||||
|
// -container: type of container: "vector", "set"...
|
||||||
|
// -value1, value2: values to store in container
|
||||||
|
// -expected_accumulate_value: expected value of an accumulation function
|
||||||
|
// computed on the container
|
||||||
|
function testContainerPtr(container, value1, value2, expected_accumulate_value)
|
||||||
|
// test container of pointers returned from flonction (expected a list)
|
||||||
|
[classAPtr_list, classAPtr1, classAPtr2] = testCreateContainerPtr(container, value1, value2);
|
||||||
|
|
||||||
|
// test container passed as value of function
|
||||||
|
func = msprintf("val_ClassAPtr_%s", container);
|
||||||
|
cmd = msprintf("classAPtr = %s(classAPtr_list);", func);
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
checkerror(ierr, cmd);
|
||||||
|
checkequal(ClassA_a_get(classAPtr), expected_accumulate_value, func);
|
||||||
|
|
||||||
|
// recreate a container
|
||||||
|
[classAPtr_list, classAPtr1, classAPtr2] = testCreateContainerPtr(container, value1, value2);
|
||||||
|
|
||||||
|
// test container passed as reference of function
|
||||||
|
func = msprintf("ref_ClassAPtr_%s", container);
|
||||||
|
cmd = msprintf("classAPtr = %s(classAPtr_list);", func);
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
checkerror(ierr, cmd);
|
||||||
|
checkequal(ClassA_a_get(classAPtr), expected_accumulate_value, func);
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
// test a given container of a given primitive type
|
||||||
|
// -container: type of container: "vector", "set"...
|
||||||
|
// -value_type: type of element stored in container: "int", ...
|
||||||
|
// -value1, value2: values to store in container
|
||||||
|
// -expected_accumulate_value: expected value of an accumulation function
|
||||||
|
// computed on the container
|
||||||
|
function testContainerType(container, value_type, value1, value2, ..
|
||||||
|
expected_returned_container, expected_accumulate_value)
|
||||||
|
// test container of basic type returned from fonction
|
||||||
|
func = msprintf("ret_%s_%s", value_type, container);
|
||||||
|
if value_type = "string" then
|
||||||
|
cmd = msprintf("c = %s(''%s'', ''%s'');", func, value1, value2);
|
||||||
|
elseif value_type = "bool" then
|
||||||
|
cmd = msprintf("c = %s(%s, %s);", func, "%"+string(value1), "%"+string(value2));
|
||||||
|
else
|
||||||
|
cmd = msprintf("c = %s(%d, %d);", func, value1, value2);
|
||||||
|
end
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
checkerror(ierr, cmd);
|
||||||
|
checkequal(c, expected_returned_container, func);
|
||||||
|
|
||||||
|
// test container passed as value of function
|
||||||
|
func = msprintf("val_%s_%s", value_type, container);
|
||||||
|
cmd = msprintf("s = %s(c);", func);
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
checkerror(ierr, cmd);
|
||||||
|
checkequal(s, expected_accumulate_value, func);
|
||||||
|
|
||||||
|
// test container passed as reference of function
|
||||||
|
func = msprintf("ref_%s_%s", value_type, container);
|
||||||
|
cmd = msprintf("s = %s(c);", func);
|
||||||
|
ierr = execstr(cmd, "errcatch");
|
||||||
|
checkerror(ierr, cmd);
|
||||||
|
checkequal(s, expected_accumulate_value, func);
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
// test a given container of different types
|
||||||
|
// -container: type of container: "vector", "set"...
|
||||||
|
function testContainer(container)
|
||||||
|
testContainerType(container, "int", 1, 2, [1, 2], 3);
|
||||||
|
testContainerType(container, "double", 2., 3., [2., 3.], 5.);
|
||||||
|
testContainerType(container, "string", "a", "b", ["a", "b"], "ab");
|
||||||
|
testContainerType(container, "bool", %F, %T, [%F, %T], %T);
|
||||||
|
testContainerPtr("vector", 1, 3, 4);
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
testContainer("vector");
|
||||||
|
testContainer("list");
|
||||||
|
testContainer("deque");
|
||||||
|
testContainer("set");
|
||||||
|
|
||||||
|
exec("swigtest.quit", -1);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
// test STL sequence containers typemaps
|
|
||||||
|
|
||||||
exec("swigtest.start", -1);
|
|
||||||
|
|
||||||
function checkerror(ierr, cmd)
|
|
||||||
if ierr <> 0 then swigtesterror("error " + string(ierr) + " in """ + cmd + """"); end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
// test sequence container of pointers returned from fonction (expected a list)
|
|
||||||
function [classAPtr_list, classAPtr1, classAPtr2] = testCreateSequenceContainerPtr(container, value1, value2)
|
|
||||||
classAPtr1 = new_ClassA(value1);
|
|
||||||
classAPtr2 = new_ClassA(value2);
|
|
||||||
cmd = msprintf("classAPtr_list = ret_ClassAPtr_%s(classAPtr1, classAPtr2);", container);
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
if ierr <> 0 then swigtesterror("error in " + cmd); end
|
|
||||||
if ~exists('classAPtr_list') | (size(classAPtr_list) <> 2) then swigtesterror(); end
|
|
||||||
if (ClassA_a_get(classAPtr_list(1)) <> value1) | (ClassA_a_get(classAPtr_list(2)) <> value2) then swigtesterror(); end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
// test sequence containers of pointers
|
|
||||||
// -container: type of container: "vector", "list"...
|
|
||||||
// -value1, value2: values to store in container
|
|
||||||
// -expected_accumulate_value: expected value of an accumulation function
|
|
||||||
// computed on the container
|
|
||||||
function testSequenceContainerPtr(container, value1, value2, expected_accumulate_value)
|
|
||||||
// test sequence container of pointers returned from flonction (expected a list)
|
|
||||||
[classAPtr_list, classAPtr1, classAPtr2] = testCreateSequenceContainerPtr(container, value1, value2);
|
|
||||||
|
|
||||||
// test sequence container passed as value of function
|
|
||||||
cmd = msprintf("classAPtr = val_ClassAPtr_%s(classAPtr_list);", container);
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
checkerror(ierr, cmd);
|
|
||||||
if ClassA_a_get(classAPtr) <> expected_accumulate_value then swigtesterror(); end
|
|
||||||
|
|
||||||
// recreate a container
|
|
||||||
[classAPtr_list, classAPtr1, classAPtr2] = testCreateSequenceContainerPtr(container, value1, value2);
|
|
||||||
|
|
||||||
// test sequence container passed as reference of function
|
|
||||||
cmd = msprintf("classAPtr = ref_ClassAPtr_%s(classAPtr_list);", container);
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
checkerror(ierr, cmd);
|
|
||||||
if ClassA_a_get(classAPtr) <> expected_accumulate_value then swigtesterror(); end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
// test sequence containers of primitive type
|
|
||||||
// -container: type of container: "vector", "list"...
|
|
||||||
// -value_type: type of element stored in container: "int", ...
|
|
||||||
// -value1, value2: values to store in container
|
|
||||||
// -expected_accumulate_value: expected value of an accumulation function
|
|
||||||
// computed on the container
|
|
||||||
function testSequenceContainer(container, value_type, value1, value2, expected_accumulate_value)
|
|
||||||
// test sequence container of basic type returned from fonction (expect a row matrix)
|
|
||||||
if value_type = "string" then
|
|
||||||
cmd = msprintf("c = ret_%s_%s(''%s'', ''%s'');", value_type, container, value1, value2);
|
|
||||||
elseif value_type = "bool" then
|
|
||||||
cmd = msprintf("c = ret_%s_%s(%s, %s);", value_type, container, "%"+string(value1), "%"+string(value2));
|
|
||||||
else
|
|
||||||
cmd = msprintf("c = ret_%s_%s(%d, %d);", value_type, container, value1, value2);
|
|
||||||
end
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
checkerror(ierr, cmd);
|
|
||||||
if ~isdef('c') | ~isequal(c, [value1, value2]) then swigtesterror(); end
|
|
||||||
|
|
||||||
// test sequence container passed as value of function
|
|
||||||
cmd = msprintf("s = val_%s_%s(c);", value_type, container);
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
checkerror(ierr, cmd);
|
|
||||||
if s <> expected_accumulate_value then swigtesterror(); end
|
|
||||||
|
|
||||||
// test sequence container passed as reference of function
|
|
||||||
cmd = msprintf("s = ref_%s_%s(c);", value_type, container);
|
|
||||||
ierr = execstr(cmd, "errcatch");
|
|
||||||
checkerror(ierr, cmd);
|
|
||||||
if s <> expected_accumulate_value then swigtesterror(); end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
// test vector
|
|
||||||
testSequenceContainer("vector", "int", 1, 2, 3);
|
|
||||||
testSequenceContainer("vector", "double", 2., 3., 5.);
|
|
||||||
testSequenceContainer("vector", "string", "a", "b", "ab");
|
|
||||||
testSequenceContainer("vector", "bool", %T, %F, %T);
|
|
||||||
testSequenceContainerPtr("vector", 1, 3, 4);
|
|
||||||
|
|
||||||
// test list
|
|
||||||
testSequenceContainer("list", "int", 1, 2, 3);
|
|
||||||
testSequenceContainer("list", "double", 2., 3., 5.);
|
|
||||||
testSequenceContainer("list", "string", "a", "b", "ab");
|
|
||||||
testSequenceContainer("list", "bool", %T, %F, %T);
|
|
||||||
testSequenceContainerPtr("list", 1, 3, 4);
|
|
||||||
|
|
||||||
// test deque
|
|
||||||
testSequenceContainer("deque", "int", 1, 2, 3);
|
|
||||||
testSequenceContainer("deque", "double", 2., 3., 5.);
|
|
||||||
testSequenceContainer("deque", "string", "a", "b", "ab");
|
|
||||||
testSequenceContainer("deque", "bool", %T, %F, %T);
|
|
||||||
testSequenceContainerPtr("deque", 1, 3, 4);
|
|
||||||
|
|
||||||
exec("swigtest.quit", -1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
// Tests C++ fonctions with STL sets as arguments
|
|
||||||
|
|
||||||
exec("swigtest.start", -1);
|
|
||||||
|
|
||||||
// integer sets
|
|
||||||
|
|
||||||
// Example of passing matrices of int as set arguments of C++ functions.");
|
|
||||||
// get a set of int {1...4} from create_integer_set():");
|
|
||||||
iset = create_integer_set(1, 4);
|
|
||||||
if ~exists("iset") | ~isequal(iset, [1 2 3 4]) then swigtesterror(); end
|
|
||||||
// get the sum of this set elements with sum_integer_set():")
|
|
||||||
isum = sum_integer_set(int32(iset));
|
|
||||||
if ~exists("isum") | (isum <> 10) then swigtesterror(); end
|
|
||||||
// get a set of of int {3...6} from create_integer_set():");
|
|
||||||
iset2 = create_integer_set(3, 6);
|
|
||||||
if ~exists("iset2") | ~isequal(iset2, [3 4 5 6]) then swigtesterror(); end
|
|
||||||
// concat the two sets with concat_integer_set():");
|
|
||||||
iset3 = concat_integer_set(int32(iset), iset2);
|
|
||||||
if ~exists("iset3") | ~isequal(iset3, [1 2 3 4 5 6]) then swigtesterror(); end
|
|
||||||
|
|
||||||
// string sets
|
|
||||||
|
|
||||||
// Example of passing matrices of string as set arguments of C++ functions.");
|
|
||||||
// get a set of string {''aa'', ''bb'', ''cc'', ''dd''} with create_string_set():");
|
|
||||||
sset = create_string_set("aa bb cc dd");
|
|
||||||
if ~exists("sset") | ~isequal(sset, ["aa" "bb" "cc" "dd"]) then swigtesterror(); end
|
|
||||||
// get a set of string {''cc'', ''dd'', ''ee'', ''ff''} with create_string_set():");
|
|
||||||
sset2 = create_string_set("cc dd ee ff");
|
|
||||||
if ~exists("sset2") | ~isequal(sset2, ["cc" "dd" "ee" "ff"]) then swigtesterror(); end
|
|
||||||
// concat the two sets with concat_string_set():");
|
|
||||||
sset3 = concat_string_set(sset, sset2);
|
|
||||||
if ~exists("sset3") | ~isequal(sset3, ["aa" "bb" "cc" "dd" "ee" "ff"]) then swigtesterror(); end
|
|
||||||
|
|
||||||
exec("swigtest.quit", -1);
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue