summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 9e996a881..1761ab0bb 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -813,6 +813,21 @@ void test_tracing() {
BinaryenSetAPITracing(0);
}
+void test_color_status() {
+ int i;
+
+ // save old state
+ const int old_state = BinaryenAreColorsEnabled();
+
+ // Check that we can set the state to both {0, 1}
+ for(i = 0; i <= 1; i++){
+ BinaryenSetColorsEnabled(i);
+ assert(BinaryenAreColorsEnabled() == i);
+ }
+
+ BinaryenSetColorsEnabled(old_state);
+}
+
int main() {
test_types();
test_core();
@@ -822,6 +837,7 @@ int main() {
test_interpret();
test_nonvalid();
test_tracing();
+ test_color_status();
return 0;
}