swig/Examples/test-suite/c/cpp11_shared_ptr_const_runme.c
Vadim Zeitlin e78c8f39ed Add minimal shared_ptr support
Enable the tests and support of shared_ptr in them for C (which required
disabling a previously passing, because not doing anything, attributes
test which is currently broken for unrelated reasons).
2021-10-15 01:26:22 +02:00

16 lines
311 B
C

#include "cpp11_shared_ptr_const_wrap.h"
#include <assert.h>
int main(int argc, const char *argv[]) {
Foo* f;
Foo* f2;
f = Foo_new(17);
assert(Foo_get_m(f) == 17);
f2 = cpp11_shared_ptr_const_foo(f);
assert(Foo_get_m(f2) == 17);
Foo_delete(f2);
Foo_delete(f);
return 0;
}