]> pd.if.org Git - lice/blobdiff - tests/_Bool.c
autocommit for files dated 2014-11-17 20:13:32
[lice] / tests / _Bool.c
diff --git a/tests/_Bool.c b/tests/_Bool.c
new file mode 100644 (file)
index 0000000..3747327
--- /dev/null
@@ -0,0 +1,32 @@
+// bool
+
+#include <stdbool.h>
+
+int main(void) {
+    expecti(__bool_true_false_are_defined, 1);
+
+    _Bool a = 0;
+    _Bool b = 1;
+    _Bool c = 2;
+    _Bool d = 3;
+
+    expecti(a, 0);
+    expecti(b, 1);
+    expecti(c, 1);
+    expecti(d, 1);
+
+    a = 3;
+    b = 2;
+    c = 1;
+    d = 0;
+
+    expecti(a, 1);
+    expecti(b, 1);
+    expecti(c, 1);
+    expecti(d, 0);
+
+    bool a1 = false;
+    a1 = !a1;
+    a1 = (a1) ? true : false;
+    expecti(a1, true);
+}