Lines Matching refs:m
45 #define FINISH_USING_CAMERA_METADATA(m) \ argument
46 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); \
47 free_camera_metadata(m); \
50 camera_metadata_t *m = NULL; in TEST() local
54 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
56 EXPECT_NOT_NULL(m); in TEST()
57 EXPECT_EQ((size_t)0, get_camera_metadata_entry_count(m)); in TEST()
58 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
59 EXPECT_EQ((size_t)0, get_camera_metadata_data_count(m)); in TEST()
60 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
62 FINISH_USING_CAMERA_METADATA(m); in TEST()
66 camera_metadata_t *m = NULL; in TEST() local
68 m = allocate_camera_metadata(1, 0); in TEST()
70 EXPECT_NOT_NULL(m); in TEST()
71 EXPECT_EQ((size_t)0, get_camera_metadata_entry_count(m)); in TEST()
72 EXPECT_EQ((size_t)1, get_camera_metadata_entry_capacity(m)); in TEST()
73 EXPECT_EQ((size_t)0, get_camera_metadata_data_count(m)); in TEST()
74 EXPECT_EQ((size_t)0, get_camera_metadata_data_capacity(m)); in TEST()
76 FINISH_USING_CAMERA_METADATA(m); in TEST()
98 camera_metadata_t *m = NULL; in TEST() local
100 m = allocate_camera_metadata(0, 0); in TEST()
102 ASSERT_NE((void*)NULL, (void*)m); in TEST()
103 EXPECT_EQ((size_t)0, get_camera_metadata_entry_count(m)); in TEST()
104 EXPECT_EQ((size_t)0, get_camera_metadata_entry_capacity(m)); in TEST()
105 EXPECT_EQ((size_t)0, get_camera_metadata_data_count(m)); in TEST()
106 EXPECT_EQ((size_t)0, get_camera_metadata_data_capacity(m)); in TEST()
110 camera_metadata_t *m = NULL; in TEST() local
125 m = place_camera_metadata(buf, buf_size, entry_capacity, data_capacity); in TEST()
127 EXPECT_EQ(buf, (uint8_t*)m); in TEST()
128 EXPECT_EQ((size_t)0, get_camera_metadata_entry_count(m)); in TEST()
129 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
130 EXPECT_EQ((size_t)0, get_camera_metadata_data_count(m)); in TEST()
131 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
133 EXPECT_EQ(OK, validate_camera_metadata_structure(m, &buf_size)); in TEST()
139 camera_metadata_t *m = NULL; in TEST() local
156 m = place_camera_metadata(buf, buf_size, entry_capacity, data_capacity); in TEST()
158 EXPECT_NULL(m); in TEST()
164 camera_metadata_t *m = NULL; in TEST() local
182 m = place_camera_metadata(buf, buf_size, entry_capacity, data_capacity); in TEST()
184 EXPECT_EQ((uint8_t*)m, buf); in TEST()
185 EXPECT_EQ((size_t)0, get_camera_metadata_entry_count(m)); in TEST()
186 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
187 EXPECT_EQ((size_t)0, get_camera_metadata_data_count(m)); in TEST()
188 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
189 EXPECT_EQ(buf + buf_size - extra_space, (uint8_t*)m + get_camera_metadata_size(m)); in TEST()
191 EXPECT_EQ(OK, validate_camera_metadata_structure(m, &buf_size)); in TEST()
197 camera_metadata_t *m = NULL; in TEST() local
201 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
204 get_camera_metadata_size(m) ); in TEST()
207 get_camera_metadata_compact_size(m) ); in TEST()
209 FINISH_USING_CAMERA_METADATA(m); in TEST()
213 camera_metadata_t *m = NULL; in TEST() local
217 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
219 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
228 result = add_camera_metadata_entry(m, in TEST()
236 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
241 result = add_camera_metadata_entry(m, in TEST()
249 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
254 result = add_camera_metadata_entry(m, in TEST()
262 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
267 result = add_camera_metadata_entry(m, in TEST()
276 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
286 result = add_camera_metadata_entry(m, in TEST()
295 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
302 result = get_camera_metadata_entry(m, in TEST()
312 result = get_camera_metadata_entry(m, in TEST()
322 result = get_camera_metadata_entry(m, in TEST()
332 result = get_camera_metadata_entry(m, in TEST()
344 result = get_camera_metadata_entry(m, in TEST()
358 get_camera_metadata_size(m) ); in TEST()
361 get_camera_metadata_compact_size(m) ); in TEST()
364 dump_camera_metadata(m, 0, 2); in TEST()
367 FINISH_USING_CAMERA_METADATA(m); in TEST()
370 void add_test_metadata(camera_metadata_t *m, int entry_count) { in add_test_metadata() argument
372 EXPECT_NOT_NULL(m); in add_test_metadata()
380 result = add_camera_metadata_entry(m, in add_test_metadata()
388 EXPECT_EQ(data_used, get_camera_metadata_data_count(m)); in add_test_metadata()
389 EXPECT_EQ(entries_used, get_camera_metadata_entry_count(m)); in add_test_metadata()
390 EXPECT_GE(get_camera_metadata_data_capacity(m), in add_test_metadata()
391 get_camera_metadata_data_count(m)); in add_test_metadata()
395 camera_metadata_t *m = NULL; in TEST() local
400 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
402 add_test_metadata(m, entry_capacity); in TEST()
405 result = add_camera_metadata_entry(m, in TEST()
414 result = get_camera_metadata_entry(m, in TEST()
427 result = get_camera_metadata_entry(m, in TEST()
436 dump_camera_metadata(m, 0, 2); in TEST()
439 FINISH_USING_CAMERA_METADATA(m); in TEST()
443 camera_metadata_t *m = NULL; in TEST() local
448 m = allocate_camera_metadata(entry_capacity + 1, data_used); in TEST()
451 add_test_metadata(m, entry_capacity); in TEST()
454 result = add_camera_metadata_entry(m, in TEST()
459 FINISH_USING_CAMERA_METADATA(m); in TEST()
463 camera_metadata_t *m = NULL; in TEST() local
467 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
469 add_test_metadata(m, entry_capacity); in TEST()
471 size_t buf_size = get_camera_metadata_compact_size(m); in TEST()
477 camera_metadata_t *m2 = copy_camera_metadata(buf, buf_size, m); in TEST()
480 EXPECT_EQ(get_camera_metadata_entry_count(m), in TEST()
482 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
489 for (unsigned int i=0; i < get_camera_metadata_entry_count(m); i++) { in TEST()
492 result = get_camera_metadata_entry(m, i, &e1); in TEST()
510 FINISH_USING_CAMERA_METADATA(m); in TEST()
514 camera_metadata_t *m = NULL; in TEST() local
520 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
522 add_test_metadata(m, entry_capacity); in TEST()
524 size_t buf_size = get_camera_metadata_compact_size(m); in TEST()
531 camera_metadata_t *m2 = copy_camera_metadata(buf, buf_size, m); in TEST()
534 EXPECT_EQ(get_camera_metadata_entry_count(m), in TEST()
536 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
545 for (unsigned int i=0; i < get_camera_metadata_entry_count(m); i++) { in TEST()
549 result = get_camera_metadata_entry(m, i, &e1); in TEST()
568 FINISH_USING_CAMERA_METADATA(m); in TEST()
572 camera_metadata_t *m = NULL; in TEST() local
576 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
578 add_test_metadata(m, entry_capacity); in TEST()
580 size_t buf_size = get_camera_metadata_compact_size(m); in TEST()
588 camera_metadata_t *m2 = copy_camera_metadata(buf, buf_size, m); in TEST()
593 FINISH_USING_CAMERA_METADATA(m); in TEST()
597 camera_metadata_t *m = NULL; in TEST() local
603 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
605 add_test_metadata(m, entry_capacity); in TEST()
612 result = append_camera_metadata(m2, m); in TEST()
616 EXPECT_EQ(get_camera_metadata_entry_count(m), in TEST()
618 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
623 for (unsigned int i=0; i < get_camera_metadata_entry_count(m); i++) { in TEST()
626 result = get_camera_metadata_entry(m, i, &e1); in TEST()
642 result = append_camera_metadata(m2, m); in TEST()
646 EXPECT_EQ(get_camera_metadata_entry_count(m)*2, in TEST()
648 EXPECT_EQ(get_camera_metadata_data_count(m)*2, in TEST()
657 result = get_camera_metadata_entry(m, in TEST()
675 FINISH_USING_CAMERA_METADATA(m); in TEST()
680 camera_metadata_t *m = NULL; in TEST() local
686 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
688 add_test_metadata(m, entry_capacity); in TEST()
695 result = append_camera_metadata(m2, m); in TEST()
701 FINISH_USING_CAMERA_METADATA(m); in TEST()
706 camera_metadata_t *m = NULL; in TEST() local
713 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
715 add_test_metadata(m, entry_capacity); in TEST()
722 result = append_camera_metadata(m2, m); in TEST()
726 EXPECT_EQ(get_camera_metadata_entry_count(m), in TEST()
728 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
733 for (unsigned int i=0; i < get_camera_metadata_entry_count(m); i++) { in TEST()
737 result = get_camera_metadata_entry(m, i, &e1); in TEST()
753 result = append_camera_metadata(m2, m); in TEST()
757 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
766 result = get_camera_metadata_entry(m, in TEST()
783 FINISH_USING_CAMERA_METADATA(m); in TEST()
788 camera_metadata_t *m = NULL; in TEST() local
793 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
796 result = add_camera_metadata_entry(m, in TEST()
800 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
802 result = add_camera_metadata_entry(m, in TEST()
806 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
814 result = add_camera_metadata_entry(m, in TEST()
818 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
820 result = add_camera_metadata_entry(m, in TEST()
824 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
826 result = add_camera_metadata_entry(m, in TEST()
830 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
846 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
848 result = add_camera_metadata_entry(m, in TEST()
852 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
854 result = add_camera_metadata_entry(m, in TEST()
858 EXPECT_EQ(OK, validate_camera_metadata_structure(m, NULL)); in TEST()
867 EXPECT_EQ(OK, find_camera_metadata_ro_entry(m, in TEST()
870 EXPECT_EQ(OK, delete_camera_metadata_entry(m, entry.index)); in TEST()
873 FINISH_USING_CAMERA_METADATA(m); in TEST()
892 camera_metadata_t *m = allocate_camera_metadata(total_tag_count, in TEST() local
895 ASSERT_NE((void*)NULL, (void*)m); in TEST()
945 result = add_camera_metadata_entry(m, in TEST()
955 dump_camera_metadata(m, 0, 2); in TEST()
958 FINISH_USING_CAMERA_METADATA(m); in TEST()
962 camera_metadata_t *m = NULL; in TEST() local
968 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
977 result = add_camera_metadata_entry(m, in TEST()
983 result = add_camera_metadata_entry(m, in TEST()
989 result = add_camera_metadata_entry(m, in TEST()
995 result = add_camera_metadata_entry(m, in TEST()
1002 result = find_camera_metadata_entry(m, in TEST()
1012 result = find_camera_metadata_entry(m, in TEST()
1025 dump_camera_metadata(m, 0, 2); in TEST()
1028 result = sort_camera_metadata(m); in TEST()
1033 dump_camera_metadata(m, 0, 2); in TEST()
1051 result = find_camera_metadata_entry(m, in TEST()
1061 result = find_camera_metadata_entry(m, in TEST()
1072 FINISH_USING_CAMERA_METADATA(m); in TEST()
1076 camera_metadata_t *m = NULL; in TEST() local
1082 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
1091 add_test_metadata(m, num_entries); in TEST()
1092 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1093 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1095 result = delete_camera_metadata_entry(m, 1); in TEST()
1100 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1101 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1102 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1103 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1105 result = delete_camera_metadata_entry(m, 4); in TEST()
1108 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1109 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1110 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1111 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1115 result = get_camera_metadata_entry(m, i, &e); in TEST()
1127 result = add_camera_metadata_entry(m, in TEST()
1133 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1134 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1135 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1136 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1139 result = get_camera_metadata_entry(m, 4, &e); in TEST()
1148 result = delete_camera_metadata_entry(m, 4); in TEST()
1152 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1153 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1154 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1155 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1157 result = delete_camera_metadata_entry(m, 4); in TEST()
1160 result = get_camera_metadata_entry(m, 4, &e); in TEST()
1163 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1164 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1165 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1166 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1169 result = delete_camera_metadata_entry(m, 3); in TEST()
1176 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1188 result = add_camera_metadata_entry(m, in TEST()
1194 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1195 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1196 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1197 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1199 result = sort_camera_metadata(m); in TEST()
1202 result = find_camera_metadata_entry(m, in TEST()
1211 result = delete_camera_metadata_entry(m, e.index); in TEST()
1215 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1216 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1217 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1218 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1222 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1233 camera_metadata_t *m = NULL; in TEST() local
1239 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
1246 add_test_metadata(m, num_entries); in TEST()
1247 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1248 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1254 result = update_camera_metadata_entry(m, in TEST()
1265 result = get_camera_metadata_entry(m, in TEST()
1276 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1287 result = update_camera_metadata_entry(m, in TEST()
1292 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1293 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1303 result = get_camera_metadata_entry(m, in TEST()
1315 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1326 result = update_camera_metadata_entry(m, in TEST()
1332 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1333 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1342 result = get_camera_metadata_entry(m, in TEST()
1353 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1365 result = add_camera_metadata_entry(m, in TEST()
1371 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1372 EXPECT_EQ(entry_capacity, get_camera_metadata_entry_capacity(m)); in TEST()
1373 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1374 EXPECT_EQ(data_capacity, get_camera_metadata_data_capacity(m)); in TEST()
1376 result = sort_camera_metadata(m); in TEST()
1379 result = find_camera_metadata_entry(m, in TEST()
1389 result = update_camera_metadata_entry(m, in TEST()
1399 result = find_camera_metadata_entry(m, in TEST()
1411 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1424 result = update_camera_metadata_entry(m, in TEST()
1432 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1433 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1446 result = find_camera_metadata_entry(m, in TEST()
1461 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1471 result = update_camera_metadata_entry(m, in TEST()
1478 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1479 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1487 result = find_camera_metadata_entry(m, in TEST()
1499 result = get_camera_metadata_entry(m, i, &e2); in TEST()
1510 result = update_camera_metadata_entry(m, in TEST()
1516 EXPECT_EQ(num_entries, get_camera_metadata_entry_count(m)); in TEST()
1517 EXPECT_EQ(num_data, get_camera_metadata_data_count(m)); in TEST()
1527 m2 = allocate_camera_metadata(get_camera_metadata_entry_count(m), in TEST()
1528 get_camera_metadata_data_count(m)); in TEST()
1531 result = append_camera_metadata(m2, m); in TEST()
1685 camera_metadata_t *m = NULL; in TEST() local
1691 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
1693 add_test_metadata(m, 5); in TEST()
1695 size_t m_size = get_camera_metadata_size(m); in TEST()
1698 memcpy(dst, m, m_size); in TEST()
1702 ASSERT_EQ(get_camera_metadata_size(m), in TEST()
1704 EXPECT_EQ(get_camera_metadata_compact_size(m), in TEST()
1706 ASSERT_EQ(get_camera_metadata_entry_count(m), in TEST()
1708 EXPECT_EQ(get_camera_metadata_entry_capacity(m), in TEST()
1710 EXPECT_EQ(get_camera_metadata_data_count(m), in TEST()
1712 EXPECT_EQ(get_camera_metadata_data_capacity(m), in TEST()
1716 for (size_t i = 0; i < get_camera_metadata_entry_count(m); i++) { in TEST()
1717 result = get_camera_metadata_entry(m, i, &e1); in TEST()
1735 result = update_camera_metadata_entry(m, 0, in TEST()
1740 result = get_camera_metadata_entry(m, 0, &e1); in TEST()
1762 result = get_camera_metadata_entry(m, 0, &e1); in TEST()
1780 FINISH_USING_CAMERA_METADATA(m); in TEST()
1785 camera_metadata_t *m = NULL; in TEST() local
1840 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
1844 add_camera_metadata_entry(m, in TEST()
1850 add_camera_metadata_entry(m, m_type_tags[m_type], in TEST()
1856 find_camera_metadata_ro_entry(m, m_type_tags[m_type], in TEST()
1868 FINISH_USING_CAMERA_METADATA(m); in TEST()
1881 camera_metadata_t *m = NULL; in TEST() local
1882 m = allocate_camera_metadata(entry_capacity, data_capacity); in TEST()
1884 add_test_metadata(m, 15); in TEST()
1886 size_t m_size = get_camera_metadata_size(m); in TEST()
1892 memcpy(dst + i, m, m_size); in TEST()
1905 FINISH_USING_CAMERA_METADATA(m); in TEST()