swig/Examples/test-suite/c/anonymous_bitfield_runme.c
Vadim Zeitlin 59c131ea08 Fix broken anonymous_bitfield C checking code
For some reason the test expected another bit field be changed when setting
the given one, which was just plain wrong and prevented the test from passing.
2016-04-21 01:37:41 +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 = new_Foo();
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);
delete_Foo(f);
return 0;
}