chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / src / test / test-alloc-util.c
index fa3bb9f440b5f2425189da1621aeb6f095ef51a8..db8991badfb046f81d1e93cd4d37ecf2a63723c7 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
 
 //#include <stdint.h>
 
@@ -57,9 +52,30 @@ static void test_memdup_multiply_and_greedy_realloc(void) {
                 assert_se(p[i] == 0);
 }
 
+static void test_bool_assign(void) {
+        bool b, c, *cp = &c, d, e, f, g, h;
+
+        b = 123;
+        *cp = -11;
+        d = 0xF & 0xFF;
+        e = b & d;
+        f = 0x0;
+        g = cp;    /* cast from pointer */
+        h = NULL;  /* cast from pointer */
+
+        assert(b);
+        assert(c);
+        assert(d);
+        assert(e);
+        assert(!f);
+        assert(g);
+        assert(!h);
+}
+
 int main(int argc, char *argv[]) {
         test_alloca();
         test_memdup_multiply_and_greedy_realloc();
+        test_bool_assign();
 
         return 0;
 }