Lines Matching refs:value
57 } value; member
76 } value; member
99 visit_type_str(v, NULL, (char **)&pt->value.string, errp); in visit_primitive_type()
102 visit_type_bool(v, NULL, &pt->value.boolean, errp); in visit_primitive_type()
105 visit_type_number(v, NULL, &pt->value.number, errp); in visit_primitive_type()
108 visit_type_int(v, NULL, &pt->value.integer, errp); in visit_primitive_type()
111 visit_type_uint8(v, NULL, &pt->value.u8, errp); in visit_primitive_type()
114 visit_type_uint16(v, NULL, &pt->value.u16, errp); in visit_primitive_type()
117 visit_type_uint32(v, NULL, &pt->value.u32, errp); in visit_primitive_type()
120 visit_type_uint64(v, NULL, &pt->value.u64, errp); in visit_primitive_type()
123 visit_type_int8(v, NULL, &pt->value.s8, errp); in visit_primitive_type()
126 visit_type_int16(v, NULL, &pt->value.s16, errp); in visit_primitive_type()
129 visit_type_int32(v, NULL, &pt->value.s32, errp); in visit_primitive_type()
132 visit_type_int64(v, NULL, &pt->value.s64, errp); in visit_primitive_type()
144 visit_type_strList(v, NULL, &pl->value.strings, errp); in visit_primitive_list()
147 visit_type_boolList(v, NULL, &pl->value.booleans, errp); in visit_primitive_list()
150 visit_type_numberList(v, NULL, &pl->value.numbers, errp); in visit_primitive_list()
153 visit_type_intList(v, NULL, &pl->value.integers, errp); in visit_primitive_list()
156 visit_type_int8List(v, NULL, &pl->value.s8_integers, errp); in visit_primitive_list()
159 visit_type_int16List(v, NULL, &pl->value.s16_integers, errp); in visit_primitive_list()
162 visit_type_int32List(v, NULL, &pl->value.s32_integers, errp); in visit_primitive_list()
165 visit_type_int64List(v, NULL, &pl->value.s64_integers, errp); in visit_primitive_list()
168 visit_type_uint8List(v, NULL, &pl->value.u8_integers, errp); in visit_primitive_list()
171 visit_type_uint16List(v, NULL, &pl->value.u16_integers, errp); in visit_primitive_list()
174 visit_type_uint32List(v, NULL, &pl->value.u32_integers, errp); in visit_primitive_list()
177 visit_type_uint64List(v, NULL, &pl->value.u64_integers, errp); in visit_primitive_list()
309 g_assert_cmpstr(pt->value.string, ==, pt_copy->value.string); in test_primitives()
310 g_free((char *)pt_copy->value.string); in test_primitives()
313 g_assert_cmpint(pt->value.boolean, ==, pt->value.boolean); in test_primitives()
316 g_assert_cmpfloat(pt->value.number, ==, pt_copy->value.number); in test_primitives()
319 g_assert_cmpint(pt->value.integer, ==, pt_copy->value.integer); in test_primitives()
322 g_assert_cmpuint(pt->value.u8, ==, pt_copy->value.u8); in test_primitives()
325 g_assert_cmpuint(pt->value.u16, ==, pt_copy->value.u16); in test_primitives()
328 g_assert_cmpuint(pt->value.u32, ==, pt_copy->value.u32); in test_primitives()
331 g_assert_cmpuint(pt->value.u64, ==, pt_copy->value.u64); in test_primitives()
334 g_assert_cmpint(pt->value.s8, ==, pt_copy->value.s8); in test_primitives()
337 g_assert_cmpint(pt->value.s16, ==, pt_copy->value.s16); in test_primitives()
340 g_assert_cmpint(pt->value.s32, ==, pt_copy->value.s32); in test_primitives()
343 g_assert_cmpint(pt->value.s64, ==, pt_copy->value.s64); in test_primitives()
359 PrimitiveList pl = { .value = { NULL } }; in test_primitive_lists()
360 PrimitiveList pl_copy = { .value = { NULL } }; in test_primitive_lists()
372 QAPI_LIST_PREPEND(pl.value.strings, g_strdup(pt->value.string)); in test_primitive_lists()
376 QAPI_LIST_PREPEND(pl.value.integers, pt->value.integer); in test_primitive_lists()
380 QAPI_LIST_PREPEND(pl.value.s8_integers, pt->value.s8); in test_primitive_lists()
384 QAPI_LIST_PREPEND(pl.value.s16_integers, pt->value.s16); in test_primitive_lists()
388 QAPI_LIST_PREPEND(pl.value.s32_integers, pt->value.s32); in test_primitive_lists()
392 QAPI_LIST_PREPEND(pl.value.s64_integers, pt->value.s64); in test_primitive_lists()
396 QAPI_LIST_PREPEND(pl.value.u8_integers, pt->value.u8); in test_primitive_lists()
400 QAPI_LIST_PREPEND(pl.value.u16_integers, pt->value.u16); in test_primitive_lists()
404 QAPI_LIST_PREPEND(pl.value.u32_integers, pt->value.u32); in test_primitive_lists()
408 QAPI_LIST_PREPEND(pl.value.u64_integers, pt->value.u64); in test_primitive_lists()
412 QAPI_LIST_PREPEND(pl.value.numbers, pt->value.number); in test_primitive_lists()
416 QAPI_LIST_PREPEND(pl.value.booleans, pt->value.boolean); in test_primitive_lists()
432 cur_head = pl_copy.value.strings; in test_primitive_lists()
435 cur_head = pl_copy.value.integers; in test_primitive_lists()
438 cur_head = pl_copy.value.s8_integers; in test_primitive_lists()
441 cur_head = pl_copy.value.s16_integers; in test_primitive_lists()
444 cur_head = pl_copy.value.s32_integers; in test_primitive_lists()
447 cur_head = pl_copy.value.s64_integers; in test_primitive_lists()
450 cur_head = pl_copy.value.u8_integers; in test_primitive_lists()
453 cur_head = pl_copy.value.u16_integers; in test_primitive_lists()
456 cur_head = pl_copy.value.u32_integers; in test_primitive_lists()
459 cur_head = pl_copy.value.u64_integers; in test_primitive_lists()
462 cur_head = pl_copy.value.numbers; in test_primitive_lists()
465 cur_head = pl_copy.value.booleans; in test_primitive_lists()
478 g_assert_cmpstr(pt->value.string, ==, ptr->value); in test_primitive_lists()
484 g_assert_cmpint(pt->value.integer, ==, ptr->value); in test_primitive_lists()
490 g_assert_cmpint(pt->value.s8, ==, ptr->value); in test_primitive_lists()
496 g_assert_cmpint(pt->value.s16, ==, ptr->value); in test_primitive_lists()
502 g_assert_cmpint(pt->value.s32, ==, ptr->value); in test_primitive_lists()
508 g_assert_cmpint(pt->value.s64, ==, ptr->value); in test_primitive_lists()
514 g_assert_cmpint(pt->value.u8, ==, ptr->value); in test_primitive_lists()
520 g_assert_cmpint(pt->value.u16, ==, ptr->value); in test_primitive_lists()
526 g_assert_cmpint(pt->value.u32, ==, ptr->value); in test_primitive_lists()
532 g_assert_cmpint(pt->value.u64, ==, ptr->value); in test_primitive_lists()
544 g_string_printf(double_expected, "%.6f", pt->value.number); in test_primitive_lists()
545 g_string_printf(double_actual, "%.6f", ptr->value); in test_primitive_lists()
554 g_assert_cmpint(!!pt->value.boolean, ==, !!ptr->value); in test_primitive_lists()
634 nested_struct_compare(listp->value, listp_copy->value); in test_nested_struct_list()
651 .value.string = "",
656 .value.string = "a b c\td",
661 .value.string = "a\nb\n",
666 .value.string = "a,b, c,d",
671 .value.string = "'a b',cd",
676 .value.string = "\"a b\",cd",
682 .value.boolean = true,
687 .value.boolean = 8,
692 .value.boolean = -1,
697 .value.boolean = false,
702 .value.boolean = 0,
708 .value.number = -1,
713 .value.number = 3.141593,
718 .value.number = DBL_MIN,
723 .value.number = DBL_MAX,
729 .value.integer = -1,
734 .value.integer = INT64_MAX / 2 + 1,
739 .value.integer = INT64_MIN,
744 .value.integer = INT64_MAX,
750 .value.u8 = 1,
755 .value.u8 = UINT8_MAX / 2 + 1,
760 .value.u8 = 0,
765 .value.u8 = UINT8_MAX,
771 .value.u16 = 1,
776 .value.u16 = UINT16_MAX / 2 + 1,
781 .value.u16 = 0,
786 .value.u16 = UINT16_MAX,
792 .value.u32 = 1,
797 .value.u32 = UINT32_MAX / 2 + 1,
802 .value.u32 = 0,
807 .value.u32 = UINT32_MAX,
813 .value.u64 = 1,
818 .value.u64 = UINT64_MAX / 2 + 1,
823 .value.u64 = 0,
828 .value.u64 = UINT64_MAX,
834 .value.s8 = -1,
839 .value.s8 = INT8_MAX / 2 + 1,
844 .value.s8 = INT8_MIN,
849 .value.s8 = INT8_MAX,
855 .value.s16 = -1,
860 .value.s16 = INT16_MAX / 2 + 1,
865 .value.s16 = INT16_MIN,
870 .value.s16 = INT16_MAX,
876 .value.s32 = -1,
881 .value.s32 = INT32_MAX / 2 + 1,
886 .value.s32 = INT32_MIN,
891 .value.s32 = INT32_MAX,
897 .value.s64 = -1,
902 .value.s64 = INT64_MAX / 2 + 1,
907 .value.s64 = INT64_MIN,
912 .value.s64 = INT64_MAX,