swig/Examples/test-suite/c/anonymous_bitfield_runme.c
Vadim Zeitlin bda731cd8f Change naming convention for wrapped ctors and dtor
Use Foo_{new,delete}() instead of {new,delete}_Foo() to ensure that all
methods of the class Foo start with the corresponding prefix.
2016-09-15 01:27:40 +02:00

29 lines
483 B
C

#include "anonymous_bitfield/anonymous_bitfield_wrap.h"
#include <assert.h>
int main(int argc, const char *argv[]) {
Foo *f = Foo_new();
assert(f != 0);
Foo_x_set(f, 1);
assert(Foo_x_get(f) == 1);
assert(Foo_y_get(f) == 0);
Foo_y_set(f, 0);
assert(Foo_x_get(f) == 1);
assert(Foo_y_get(f) == 0);
Foo_f_set(f, 1);
assert(Foo_f_get(f) == 1);
Foo_z_set(f, 1);
assert(Foo_z_get(f) == 1);
Foo_seq_set(f, 1);
assert(Foo_seq_get(f) == 1);
Foo_delete(f);
return 0;
}