From 56db1d6e4ec88d73779429e4c89b137153a278f8 Mon Sep 17 00:00:00 2001 From: Leif Middelschulte Date: Thu, 9 Aug 2012 20:03:42 +0000 Subject: [PATCH] Add C backend runtime implementation for basic C++ std::vector test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13581 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/c/Makefile.in | 1 + .../c/cpp_basic_std_vector_built_in_runme.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c diff --git a/Examples/test-suite/c/Makefile.in b/Examples/test-suite/c/Makefile.in index e64b4a0f1..165b80875 100644 --- a/Examples/test-suite/c/Makefile.in +++ b/Examples/test-suite/c/Makefile.in @@ -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 diff --git a/Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c b/Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c new file mode 100644 index 000000000..08835bfd0 --- /dev/null +++ b/Examples/test-suite/c/cpp_basic_std_vector_built_in_runme.c @@ -0,0 +1,19 @@ +#include +#include "cpp_basic_std_vector_built_in/cpp_basic_std_vector_built_in_proxy.h" +#include + +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); +} \ No newline at end of file