23 #include <glib/gstdio.h>
25 #include "../lib/grn-assertions.h"
27 #define COORDINATE(hours, minutes, seconds) \
28 GRN_TEST_GEO_COORDINATE(hours, minutes, seconds)
30 #define POINT(latitude_hours, latitude_minutes, latitude_seconds, \
31 longitude_hours, longitude_minutes, longitude_seconds) \
32 GRN_TEST_GEO_POINT_STRING( \
33 COORDINATE(latitude_hours, latitude_minutes, latitude_seconds), \
34 COORDINATE(longitude_hours, longitude_minutes, longitude_seconds))
36 #define TAKEN_POINT(latitude_hours, latitude_minutes, latitude_seconds, \
37 longitude_hours, longitude_minutes, longitude_seconds) \
38 cut_take_string(POINT(latitude_hours, latitude_minutes, latitude_seconds, \
39 longitude_hours, longitude_minutes, longitude_seconds))
58 static gchar *tmp_directory;
68 "table-patricia-trie-cursor",
75 g_free(tmp_directory);
80 remove_tmp_directory(
void)
82 cut_remove_path(tmp_directory, NULL);
88 const gchar *database_path;
90 remove_tmp_directory();
91 g_mkdir_with_parents(tmp_directory, 0700);
96 database_path = cut_build_path(tmp_directory,
"database.groonga", NULL);
119 create_short_text_table(
const GList *texts)
121 const gchar *table_name =
"ShortTextPat";
126 cut_take_printf(
"table_create %s TABLE_PAT_KEY ShortText", table_name));
128 command = g_string_new(NULL);
129 g_string_append_printf(command,
"load --table %s\n", table_name);
130 g_string_append(command,
"[\n");
131 g_string_append(command,
" [\"_key\"],\n");
132 for (node = texts;
node; node = g_list_next(node)) {
133 const gchar *text = node->data;
134 g_string_append_printf(command,
" [\"%s\"]", text);
135 if (g_list_next(node)) {
136 g_string_append(command,
",");
138 g_string_append(command,
"\n");
140 g_string_append(command,
"]");
143 table =
grn_ctx_get(context, table_name, strlen(table_name));
147 create_uint32_table(
void)
149 const char *table_name =
"UInt32Pat";
152 cut_take_printf(
"table_create %s TABLE_PAT_KEY UInt32", table_name));
154 cut_take_printf(
"load --table %s\n"
170 table =
grn_ctx_get(context, table_name, strlen(table_name));
174 create_geo_point_table(
const gchar *data)
176 const char *table_name =
"GeoPointPat";
179 cut_take_printf(
"table_create %s TABLE_PAT_KEY WGS84GeoPoint", table_name));
181 cut_take_printf(
"load --table %s\n"
189 table =
grn_ctx_get(context, table_name, strlen(table_name));
193 cast_to_geo_point(
grn_obj *geo_point,
const gchar *geo_point_string)
197 if (!geo_point_string) {
210 #define ADD_DATA(label, rc, message, offset, limit) \
211 gcut_add_datum(label, \
212 "rc", G_TYPE_UINT, rc, \
213 "message", G_TYPE_STRING, message, \
214 "offset", G_TYPE_INT, offset, \
215 "limit", G_TYPE_INT, limit, \
220 "can't use negative offset with GRN_CURSOR_PREFIX: -1",
224 "offset is rather than table size: offset:100, table_size:8",
228 "can't use small limit rather than -1 with GRN_CURSOR_PREFIX: -2",
237 const gchar *min =
"ab";
240 create_short_text_table(gcut_take_new_list_string(
"abra",
250 offset = gcut_data_get_int(data,
"offset");
251 limit = gcut_data_get_int(data,
"limit");
258 gcut_data_get_string(data,
"message"),
265 #define ADD_DATA(label, expected, min, offset, limit, flags) \
266 gcut_add_datum(label, \
267 "expected", G_TYPE_POINTER, \
268 expected, gcut_list_string_free, \
269 "min", G_TYPE_STRING, min, \
270 "offset", G_TYPE_INT, offset, \
271 "limit", G_TYPE_INT, limit, \
272 "flags", G_TYPE_INT, flags, \
276 gcut_list_string_new(
"abra",
"abracada",
"abracadabra",
"abubu",
282 gcut_list_string_new(
"abubu",
"abracadabra",
"abracada",
"abra",
287 ADD_DATA(
"alphabet - ascending - greater than",
288 gcut_list_string_new(
"abracada",
"abracadabra", NULL),
292 ADD_DATA(
"alphabet - descending - greater than",
293 gcut_list_string_new(
"abracadabra",
"abracada", NULL),
297 ADD_DATA(
"alphabet - offset and limit",
298 gcut_list_string_new(
"abracadabra", NULL),
307 ADD_DATA(
"no match - common prefix",
313 gcut_list_string_new(
"abra",
"abracada",
"abracadabra",
"abubu",
314 "あ",
"ああ",
"あああ",
"い",
338 int offset, limit, flags;
339 const GList *expected_keys;
340 GList *actual_keys = NULL;
342 create_short_text_table(gcut_take_new_list_string(
"abra",
352 min = gcut_data_get_string(data,
"min");
353 offset = gcut_data_get_int(data,
"offset");
354 limit = gcut_data_get_int(data,
"limit");
355 flags = gcut_data_get_int(data,
"flags");
367 actual_keys = g_list_append(actual_keys, g_strndup(key, key_size));
369 gcut_take_list(actual_keys, g_free);
371 expected_keys = gcut_data_get_pointer(data,
"expected");
372 gcut_assert_equal_list_string(expected_keys, actual_keys);
376 geo_byte_parse(
const gchar *geo_byte_string)
382 while (geo_byte_string[0]) {
383 switch (geo_byte_string[0]) {
385 geo_byte[i / 8] &= ~(1 << (7 - (i % 8)));
389 geo_byte[i / 8] |= 1 << (7 - (i % 8));
398 return cut_take_printf(
"%dx%d",
400 geo_point.longitude);
404 geo_byte_list_new_va_list(
const gchar *value, va_list args)
409 list = g_list_prepend(list, g_strdup(geo_byte_parse(value)));
410 value = va_arg(args,
const gchar *);
413 return g_list_reverse(list);
417 geo_byte_load_data(
const gchar *value, ...)
423 va_start(args, value);
424 list = geo_byte_list_new_va_list(value, args);
427 data = g_string_new(NULL);
428 for (node = list;
node; node = g_list_next(node)) {
429 const gchar *point = node->data;
430 g_string_append_printf(data,
"[\"%s\"]", point);
431 if (g_list_next(node)) {
432 g_string_append_printf(data,
",\n");
435 gcut_list_string_free(list);
437 return cut_take_string(g_string_free(data,
FALSE));
443 #define ADD_DATA(label, expected, min, min_size, offset, limit, flags) \
444 gcut_add_datum(label, \
445 "expected", G_TYPE_POINTER, \
446 expected, gcut_list_string_free, \
447 "min", G_TYPE_STRING, min, \
448 "min-size", G_TYPE_UINT, min_size, \
449 "offset", G_TYPE_INT, offset, \
450 "limit", G_TYPE_INT, limit, \
451 "flags", G_TYPE_INT, flags, \
456 gcut_list_string_new(
457 "00000000 00111111 01010000 00000000 01111101 00010000 00011101 00001111",
458 "00000000 00111111 01010000 00000001 00011110 01010001 01101001 00110000",
459 "00000000 00111111 01010000 00001101 01011101 01011011 01011001 01010011",
460 "00000000 00111111 01010000 00001111 00101011 00011111 00110011 00001001",
461 "00000000 00111111 01010000 00010010 00110001 00001000 00001010 00110011",
462 "00000000 00111111 01010000 00010010 00110001 00110111 01111000 01110000",
463 "00000000 00111111 01010000 00011000 01110000 00001011 00101110 01001010",
464 "00000000 00111111 01010000 00100000 00010111 01000111 00110100 00101010",
465 "00000000 00111111 01010000 00100010 00100111 01000011 00000010 01101001",
466 "00000000 00111111 01010000 00100010 00111011 01000000 00111000 01100100",
467 "00000000 00111111 01010000 00100011 00000001 00000111 01011100 01110011",
468 "00000000 00111111 01010000 00100011 00001010 00000000 00001101 00111010",
469 "00000000 00111111 01010000 00100011 01100100 01011000 00000111 01110010",
470 "00000000 00111111 01010000 00101101 00101000 00111111 01010110 00010110",
471 "00000000 00111111 01010000 00101101 01111100 01101100 00111000 01111001",
472 "00000000 00111111 01010000 00101110 01010011 00101001 00101001 00100011",
473 "00000000 00111111 01010000 00101110 01110010 00111001 00011011 01101010",
474 "00000000 00111111 01010000 00101111 00011000 01000110 00100101 01011110",
475 "00000000 00111111 01010000 00101111 01001010 01101000 01000100 01100011",
476 "00000000 00111111 01010000 00110000 01001010 01011100 01101010 00010001",
477 "00000000 00111111 01010000 00111000 01100100 01101011 01111100 01111011",
478 "00000000 00111111 01010000 00111001 00111101 00001001 00001011 01010011",
479 "00000000 00111111 01010000 00111010 01011111 00000010 00101001 01010000",
481 "00000000 00111111 01010000 00000000 00000000 00000000 00000000 00000000",
487 gcut_list_string_new(
488 "00000000 00111111 01010000 00111010 01011111 00000010 00101001 01010000",
489 "00000000 00111111 01010000 00111001 00111101 00001001 00001011 01010011",
490 "00000000 00111111 01010000 00111000 01100100 01101011 01111100 01111011",
491 "00000000 00111111 01010000 00110000 01001010 01011100 01101010 00010001",
492 "00000000 00111111 01010000 00101111 01001010 01101000 01000100 01100011",
493 "00000000 00111111 01010000 00101111 00011000 01000110 00100101 01011110",
494 "00000000 00111111 01010000 00101110 01110010 00111001 00011011 01101010",
495 "00000000 00111111 01010000 00101110 01010011 00101001 00101001 00100011",
496 "00000000 00111111 01010000 00101101 01111100 01101100 00111000 01111001",
497 "00000000 00111111 01010000 00101101 00101000 00111111 01010110 00010110",
498 "00000000 00111111 01010000 00100011 01100100 01011000 00000111 01110010",
499 "00000000 00111111 01010000 00100011 00001010 00000000 00001101 00111010",
500 "00000000 00111111 01010000 00100011 00000001 00000111 01011100 01110011",
501 "00000000 00111111 01010000 00100010 00111011 01000000 00111000 01100100",
502 "00000000 00111111 01010000 00100010 00100111 01000011 00000010 01101001",
503 "00000000 00111111 01010000 00100000 00010111 01000111 00110100 00101010",
504 "00000000 00111111 01010000 00011000 01110000 00001011 00101110 01001010",
505 "00000000 00111111 01010000 00010010 00110001 00110111 01111000 01110000",
506 "00000000 00111111 01010000 00010010 00110001 00001000 00001010 00110011",
507 "00000000 00111111 01010000 00001111 00101011 00011111 00110011 00001001",
508 "00000000 00111111 01010000 00001101 01011101 01011011 01011001 01010011",
509 "00000000 00111111 01010000 00000001 00011110 01010001 01101001 00110000",
510 "00000000 00111111 01010000 00000000 01111101 00010000 00011101 00001111",
512 "00000000 00111111 01010000 00000000 00000000 00000000 00000000 00000000",
517 "bit - different prefix",
518 gcut_list_string_new(
519 "00000000 00111101 01010101 00111101 01110000 01001011 01110011 00101100",
521 "00000000 00111101 01010101 00111101 01110000 00000000 00000000 00000001",
526 "bit - border prefix",
527 gcut_list_string_new(
528 "00000000 00111101 00000101 00111101 01110000 01001011 01110011 00101100",
530 "00000000 00111101 00000101 00111101 01110000 00000000 00000000 00000001",
543 int offset, limit, flags;
545 const GList *expected_keys;
546 GList *actual_keys = NULL;
549 create_geo_point_table(
551 "00000000 00111111 01010000 00110000 01001010 01011100 01101010 00010001",
552 "00000000 00111111 01010000 00001101 01011101 01011011 01011001 01010011",
553 "00000000 00111111 01010000 00000001 00011110 01010001 01101001 00110000",
554 "00000000 00111111 01010000 00011000 01110000 00001011 00101110 01001010",
555 "00000000 00111111 01010000 00010010 00110001 00110111 01111000 01110000",
556 "00000000 00111111 01010000 00010010 00110001 00001000 00001010 00110011",
557 "00000000 00111111 01010000 00101110 01110010 00111001 00011011 01101010",
558 "00000000 00111111 01010000 00101101 00101000 00111111 01010110 00010110",
559 "00000000 00111111 01010000 00101111 01001010 01101000 01000100 01100011",
560 "00000000 00111111 01010000 00101111 00011000 01000110 00100101 01011110",
561 "00000000 00111111 01000101 01011001 01010110 00000111 00110100 01111111",
562 "00000000 00111111 01000101 01010010 01100101 01100110 00010111 01111110",
563 "00000000 00111111 01000101 01111111 01011011 01111101 00001001 01100001",
564 "00000000 00111111 01010000 00100011 00001010 00000000 00001101 00111010",
565 "00000000 00111111 01010000 00101110 01010011 00101001 00101001 00100011",
566 "00000000 00111111 01010000 00111010 01011111 00000010 00101001 01010000",
567 "00000000 00111111 01010000 00111001 00111101 00001001 00001011 01010011",
568 "00000000 00111111 01000101 01011100 00001100 01000001 01011010 00010011",
569 "00000000 00111111 01010000 00100011 00000001 00000111 01011100 01110011",
570 "00000000 00111111 01010000 00100011 01100100 01011000 00000111 01110010",
571 "00000000 00111111 01010000 00111000 01100100 01101011 01111100 01111011",
572 "00000000 00111111 01010000 00001111 00101011 00011111 00110011 00001001",
573 "00000000 00111111 01000101 01111011 01001011 01101011 00001001 00000001",
574 "00000000 00111111 01000101 01011010 00110100 00000010 01111010 00000000",
575 "00000000 00111111 01000101 01011011 00011010 00010111 00011000 00100000",
576 "00000000 00111111 01010000 00100000 00010111 01000111 00110100 00101010",
577 "00000000 00111111 01010000 00000000 01111101 00010000 00011101 00001111",
578 "00000000 00111111 01000101 01000100 01010010 00100100 01100011 00111011",
579 "00000000 00111111 01000101 01010001 00011100 01010110 00100110 00000110",
580 "00000000 00111111 01010000 00101101 01111100 01101100 00111000 01111001",
581 "00000000 00111111 01000101 01001101 00111110 00000101 00101010 01000101",
582 "00000000 00111111 01000101 01000100 01111100 01101011 01101111 00010101",
583 "00000000 00111111 01000101 01110111 01010100 01110100 01111000 01111000",
584 "00000000 00111111 01010000 00100010 00111011 01000000 00111000 01100100",
585 "00000000 00111111 01010000 00100010 00100111 01000011 00000010 01101001",
586 "00000000 00111111 01000101 01011100 00110110 00100010 00111000 01100001",
587 "00000000 00111101 01010101 00111101 01110000 01001011 01110011 00101100",
588 "00000000 00111101 00000101 00111101 01110000 01001011 01110011 00101100",
591 cast_to_geo_point(&min, geo_byte_parse(gcut_data_get_string(data,
"min")));
593 min_size = gcut_data_get_uint(data,
"min-size");
594 offset = gcut_data_get_int(data,
"offset");
595 limit = gcut_data_get_int(data,
"limit");
596 flags = gcut_data_get_int(data,
"flags");
611 grn_gton(encoded_key, key, key_size);
612 geo_byte = g_string_new(NULL);
615 g_string_append(geo_byte,
" ");
617 for (j = 0; j < 8; j++) {
618 g_string_append_printf(geo_byte,
"%d", (encoded_key[i] >> (7 - j)) & 1);
621 actual_keys = g_list_append(actual_keys, g_string_free(geo_byte,
FALSE));
623 gcut_take_list(actual_keys, g_free);
625 expected_keys = gcut_data_get_pointer(data,
"expected");
626 gcut_assert_equal_list_string(expected_keys, actual_keys);
629 #define ADD_DATA(label, expected, min, offset, limit) \
630 gcut_add_datum(label " - [" min "]", \
631 "expected", G_TYPE_POINTER, \
632 expected, gcut_list_string_free, \
633 "min", G_TYPE_STRING, min, \
634 "offset", G_TYPE_INT, offset, \
635 "limit", G_TYPE_INT, limit, \
639 data_prefix_rk_basic(
void)
642 gcut_list_string_new(
"カネソナエタ",
657 gcut_list_string_new(
"コウセイド",
663 gcut_list_string_new(
"コウセイド",
669 gcut_list_string_new(
"コウセイド",
677 data_prefix_rk_xtsu(
void)
680 gcut_list_string_new(
"インデックス",
685 gcut_list_string_new(
"インデックス",
690 gcut_list_string_new(
"インデックス",
695 gcut_list_string_new(
"インデックス",
700 gcut_list_string_new(
"インデックス",
705 gcut_list_string_new(
"インデックス",
710 gcut_list_string_new(
"インデックス",
715 gcut_list_string_new(
"インデックス",
720 gcut_list_string_new(
"インデックス",
727 data_prefix_rk_xyu(
void)
730 gcut_list_string_new(
"ヨウキュウ",
735 gcut_list_string_new(
"ヨウキュウ",
740 gcut_list_string_new(
"ヨウキュウ",
745 gcut_list_string_new(
"ヨウキュウ",
750 gcut_list_string_new(
"ヨウキュウ",
755 gcut_list_string_new(
"ヨウキュウ",
760 gcut_list_string_new(
"ヨウキュウ",
765 gcut_list_string_new(
"ヨウキュウ",
772 data_prefix_rk_offset_and_limit(
void)
775 gcut_list_string_new(
"キノウ",
787 gcut_list_string_new(
"カネソナエタ",
794 gcut_list_string_new(
"キノウ",
805 data_prefix_rk_no_match(
void)
811 ADD_DATA(
"roman - upcase - no match",
828 data_prefix_rk_basic();
829 data_prefix_rk_xtsu();
830 data_prefix_rk_xyu();
831 data_prefix_rk_offset_and_limit();
832 data_prefix_rk_no_match();
842 const GList *expected_keys;
843 GList *actual_keys = NULL;
845 create_short_text_table(
846 gcut_take_new_list_string(
"インデックス",
881 min = gcut_data_get_string(data,
"min");
882 offset = gcut_data_get_int(data,
"offset");
883 limit = gcut_data_get_int(data,
"limit");
895 actual_keys = g_list_append(actual_keys, g_strndup(key, key_size));
897 actual_keys = g_list_sort(actual_keys, (GCompareFunc)strcmp);
898 gcut_take_list(actual_keys, g_free);
900 expected_keys = gcut_data_get_pointer(data,
"expected");
901 gcut_assert_equal_list_string(expected_keys, actual_keys);
905 uint_list_new(gint n, guint value, ...)
911 va_start(args, value);
912 for (i = 0; i < n; i++) {
913 list = g_list_prepend(list, GUINT_TO_POINTER(value));
914 value = va_arg(args, guint);
918 return g_list_reverse(list);
924 #define ADD_DATA(label, expected, min_size, max, offset, limit, flags) \
925 gcut_add_datum(label, \
926 "expected", G_TYPE_POINTER, \
927 expected, g_list_free, \
928 "min-size", G_TYPE_INT, min_size, \
929 "max", G_TYPE_UINT, max, \
930 "offset", G_TYPE_INT, offset, \
931 "limit", G_TYPE_INT, limit, \
932 "flags", G_TYPE_INT, flags, \
937 0x00000000U, 0x00000004U, 0x00000080U,
938 0xdeadbeefU, 0xffffffffU),
943 uint_list_new(3, 0x00000000U, 0x00000004U, 0x00000080U),
955 int min_size, offset, limit, flags;
957 const GList *expected_keys;
958 GList *actual_keys = NULL;
960 create_uint32_table();
962 min_size = gcut_data_get_int(data,
"min-size");
963 max = gcut_data_get_uint(data,
"max");
964 offset = gcut_data_get_int(data,
"offset");
965 limit = gcut_data_get_int(data,
"limit");
966 flags = gcut_data_get_int(data,
"flags");
978 actual_keys = g_list_append(actual_keys, GUINT_TO_POINTER(*key));
980 gcut_take_list(actual_keys, NULL);
982 expected_keys = gcut_data_get_pointer(data,
"expected");
983 gcut_assert_equal_list_uint(expected_keys, actual_keys);
989 #define ADD_DATA(label, expected, min_size, max, offset, limit, flags) \
990 gcut_add_datum(label, \
991 "expected", G_TYPE_POINTER, \
992 expected, gcut_list_string_free, \
993 "min-size", G_TYPE_UINT, min_size, \
994 "max", G_TYPE_STRING, max, \
995 "offset", G_TYPE_INT, offset, \
996 "limit", G_TYPE_INT, limit, \
997 "flags", G_TYPE_INT, flags, \
1046 int min_size, offset, limit, flags;
1048 const GList *expected_keys;
1049 GList *actual_keys = NULL;
1052 create_geo_point_table(
1053 cut_take_printf(
" [\"%s\"],"
1081 min_size = gcut_data_get_int(data,
"min-size");
1082 cast_to_geo_point(&max, gcut_data_get_string(data,
"max"));
1083 offset = gcut_data_get_int(data,
"offset");
1084 limit = gcut_data_get_int(data,
"limit");
1085 flags = gcut_data_get_int(data,
"flags");
1098 actual_keys = g_list_append(actual_keys,
1099 g_strdup_printf(
"%dx%d",
1103 gcut_take_list(actual_keys, g_free);
1105 expected_keys = gcut_data_get_pointer(data,
"expected");
1106 gcut_assert_equal_list_string(expected_keys, actual_keys);
1112 #define ADD_DATA(label, expected, min_size, max, offset, limit, flags) \
1113 gcut_add_datum(label, \
1114 "expected", G_TYPE_POINTER, \
1115 expected, gcut_list_string_free, \
1116 "min-size", G_TYPE_INT, min_size, \
1117 "max", G_TYPE_STRING, max, \
1118 "offset", G_TYPE_INT, offset, \
1119 "limit", G_TYPE_INT, limit, \
1120 "flags", G_TYPE_INT, flags, \
1124 gcut_list_string_new(
"abracada",
"abra",
1130 gcut_list_string_new(
"abracadabra",
"abracada",
1135 ADD_DATA(
"alphabet - offset and limit",
1136 gcut_list_string_new(
"abra", NULL),
1145 ADD_DATA(
"no match - common prefix",
1151 gcut_list_string_new(
"abra",
"abracada",
"abracadabra",
"abubu",
1152 "あ",
"ああ",
"あああ",
"い",
1176 int min_size, offset, limit, flags;
1177 const GList *expected_keys;
1178 GList *actual_keys = NULL;
1180 create_short_text_table(gcut_take_new_list_string(
"abra",
1190 min_size = gcut_data_get_int(data,
"min-size");
1191 max = gcut_data_get_string(data,
"max");
1192 offset = gcut_data_get_int(data,
"offset");
1193 limit = gcut_data_get_int(data,
"limit");
1194 flags = gcut_data_get_int(data,
"flags");
1206 actual_keys = g_list_append(actual_keys, g_strndup(key, key_size));
1208 gcut_take_list(actual_keys, g_free);
1210 expected_keys = gcut_data_get_pointer(data,
"expected");
1211 gcut_assert_equal_list_string(expected_keys, actual_keys);
1217 #define ADD_DATA(label, expected, min, min_size, max, max_size, \
1218 offset, limit, flags) \
1219 gcut_add_datum(label, \
1220 "expected", G_TYPE_POINTER, \
1221 expected, gcut_list_string_free, \
1222 "min", G_TYPE_STRING, min, \
1223 "min-size", G_TYPE_UINT, min_size, \
1224 "max", G_TYPE_STRING, max, \
1225 "max-size", G_TYPE_UINT, max_size, \
1226 "offset", G_TYPE_INT, offset, \
1227 "limit", G_TYPE_INT, limit, \
1228 "flags", G_TYPE_INT, flags, \
1232 gcut_list_string_new(
"128592911x503145263",
1233 "128597458x502942345",
1234 "128572751x502866155",
1235 "128513714x503319780",
1236 "128320340x502334363",
1243 gcut_list_string_new(
"128320340x502334363",
1244 "128513714x503319780",
1245 "128572751x502866155",
1246 "128597458x502942345",
1247 "128592911x503145263",
1254 gcut_list_string_new(
"128572751x502866155",
1255 "128513714x503319780",
1256 "128320340x502334363",
1263 gcut_list_string_new(
"128572751x502866155",
1264 "128597458x502942345",
1265 "128592911x503145263",
1280 unsigned min_size, max_size;
1281 int offset, limit, flags;
1282 const GList *expected_keys;
1283 GList *actual_keys = NULL;
1287 create_geo_point_table(
"[\"128592911x503145263\"],\n"
1288 "[\"128565076x502976128\"],\n"
1289 "[\"128597458x502942345\"],\n"
1290 "[\"128572751x502866155\"],\n"
1291 "[\"128521858x503341754\"],\n"
1292 "[\"128513714x503319780\"],\n"
1293 "[\"128534177x502693614\"],\n"
1294 "[\"128320340x502334363\"]\n");
1299 cast_to_geo_point(&min, gcut_data_get_string(data,
"min"));
1300 min_size = gcut_data_get_uint(data,
"min-size");
1301 cast_to_geo_point(&max, gcut_data_get_string(data,
"max"));
1302 max_size = gcut_data_get_uint(data,
"max-size");
1303 offset = gcut_data_get_int(data,
"offset");
1304 limit = gcut_data_get_int(data,
"limit");
1305 flags = gcut_data_get_int(data,
"flags");
1321 actual_keys = g_list_append(actual_keys,
1322 g_strdup_printf(
"%dx%d",
1326 gcut_take_list(actual_keys, g_free);
1328 expected_keys = gcut_data_get_pointer(data,
"expected");
1329 gcut_assert_equal_list_string(expected_keys, actual_keys);