8
test_bson_boolean (void)
13
ok (bson_append_boolean (b, "FALSE", FALSE),
14
"bson_append_boolean() works");
15
ok (bson_append_boolean (b, "TRUE", TRUE),
16
"bson_append_boolean() works still");
19
cmp_ok (bson_size (b), "==", 20, "BSON boolean element size check");
20
ok (memcmp (bson_data (b),
21
"\024\000\000\000\010\106\101\114\123\105\000\000\010\124\122"
22
"\125\105\000\001\000",
24
"BSON boolean element contents check");
29
ok (bson_append_boolean (b, NULL, TRUE) == FALSE,
30
"bson_append_boolean() with a NULL key should fail");
31
ok (bson_append_boolean (NULL, "TRUE", TRUE) == FALSE,
32
"bson_append_boolean() without a BSON object should fail");
34
cmp_ok (bson_size (b), "==", 5,
35
"BSON object should be empty");
37
ok (bson_append_boolean (b, "b", TRUE) == FALSE,
38
"Appending to a finished element should fail");
43
RUN_TEST (8, bson_boolean);