Add C backend runtime implementation for basic C++ std::vector<int> test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13581 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c3236edf80
commit
56db1d6e4e
2 changed files with 20 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ CPP_TEST_CASES += \
|
|||
cpp_basic_namespaced_class \
|
||||
cpp_basic_template_function \
|
||||
cpp_basic_template_class \
|
||||
cpp_basic_std_vector_built_in \
|
||||
c_backend_cpp_natural_std_string \
|
||||
c_backend_cpp_exception
|
||||
|
||||
|
|
|
|||
19
Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c
Normal file
19
Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <assert.h>
|
||||
#include "cpp_basic_std_vector_built_in/cpp_basic_std_vector_built_in_proxy.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
Int_Vector *myIntVector = new_Int_Vector_size_t(42);
|
||||
|
||||
assert(Int_Vector_capacity(myIntVector) == 42);
|
||||
Int_Vector_push_back(myIntVector, 4711);
|
||||
assert(Int_Vector_size(myIntVector) == 43);
|
||||
assert(Int_Vector_at(myIntVector, 42) == 4711);
|
||||
Int_Vector_clear(myIntVector);
|
||||
assert(Int_Vector_empty(myIntVector));
|
||||
assert(Int_Vector_size(myIntVector) == 0);
|
||||
Int_Vector_push_back(myIntVector, 23);
|
||||
assert(Int_Vector_size(myIntVector) == 1);
|
||||
|
||||
delete_Int_Vector(myIntVector);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue