mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
tests: assertion macros
This commit is contained in:
@@ -36,13 +36,12 @@ static void assert_is_object(cJSON *object_item)
|
||||
{
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(object_item, "Item is NULL.");
|
||||
|
||||
TEST_ASSERT_NULL_MESSAGE(object_item->next, "Linked list next pointer is not NULL.");
|
||||
TEST_ASSERT_NULL_MESSAGE(object_item->prev, "Linked list previous pointer is not NULL");
|
||||
TEST_ASSERT_BITS_MESSAGE(0xFF, cJSON_Object, object_item->type, "Item type is not object.");
|
||||
TEST_ASSERT_BITS_MESSAGE(cJSON_IsReference, 0, object_item->type, "Item should not have a string as reference.");
|
||||
TEST_ASSERT_BITS_MESSAGE(cJSON_StringIsConst, 0, object_item->type, "Item should not have a const string.");
|
||||
TEST_ASSERT_NULL_MESSAGE(object_item->valuestring, "Valuestring is not NULL.");
|
||||
TEST_ASSERT_NULL_MESSAGE(object_item->string, "String is not NULL.");
|
||||
assert_not_in_list(object_item);
|
||||
assert_has_type(object_item, cJSON_Object);
|
||||
assert_has_no_reference(object_item);
|
||||
assert_has_no_const_string(object_item);
|
||||
assert_has_no_valuestring(object_item);
|
||||
assert_has_no_string(object_item);
|
||||
}
|
||||
|
||||
static void assert_is_child(cJSON *child_item, const char *name, int type)
|
||||
|
||||
Reference in New Issue
Block a user