[Groonga-commit] groonga/groonga [master] test: add test data for all key supported tables

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Feb 5 18:06:40 JST 2013


Kouhei Sutou	2013-02-05 18:06:40 +0900 (Tue, 05 Feb 2013)

  New Revision: 0f2291646c73c88a5df1374fbfa96fb133101df8
  https://github.com/groonga/groonga/commit/0f2291646c73c88a5df1374fbfa96fb133101df8

  Log:
    test: add test data for all key supported tables

  Modified files:
    test/unit/core/test-table-cursor.c

  Modified: test/unit/core/test-table-cursor.c (+19 -8)
===================================================================
--- test/unit/core/test-table-cursor.c    2013-02-05 17:54:10 +0900 (ff78995)
+++ test/unit/core/test-table-cursor.c    2013-02-05 18:06:40 +0900 (6024f51)
@@ -119,14 +119,23 @@ test_table(gconstpointer data)
 void
 data_normalize(void)
 {
-#define ADD_DATA(label, key)                    \
-  gcut_add_datum(label,                         \
-                 "key", G_TYPE_STRING, key,     \
+#define ADD_DATA(label, table_type, key)                        \
+  gcut_add_datum(label,                                         \
+                 "table_type", G_TYPE_STRING, table_type,       \
+                 "key", G_TYPE_STRING, key,                     \
                  NULL)
 
-  ADD_DATA("lower", "alice");
-  ADD_DATA("upper", "ALICE");
-  ADD_DATA("mixed", "AlIcE");
+  ADD_DATA("hash table - lower",        "TABLE_HASH_KEY", "alice");
+  ADD_DATA("hash table - upper",        "TABLE_HASH_KEY", "ALICE");
+  ADD_DATA("hash table - mixed",        "TABLE_HASH_KEY", "AlIcE");
+
+  ADD_DATA("patricia trie - lower",     "TABLE_PAT_KEY",  "alice");
+  ADD_DATA("patricia trie - upper",     "TABLE_PAT_KEY",  "ALICE");
+  ADD_DATA("patricia trie - mixed",     "TABLE_PAT_KEY",  "AlIcE");
+
+  ADD_DATA("double array trie - lower", "TABLE_DAT_KEY",  "alice");
+  ADD_DATA("double array trie - upper", "TABLE_DAT_KEY",  "ALICE");
+  ADD_DATA("double array trie - mixed", "TABLE_DAT_KEY",  "AlIcE");
 
 #undef ADD_DATA
 }
@@ -139,8 +148,10 @@ test_normalize(gconstpointer data)
   GList *actual_keys = NULL;
   grn_table_cursor *cursor;
 
-  assert_send_command("table_create Users TABLE_HASH_KEY ShortText "
-                      "--normalizer NormalizerAuto");
+  assert_send_command(
+    cut_take_printf("table_create Users %s ShortText "
+                      "--normalizer NormalizerAuto",
+                    gcut_data_get_string(data, "table_type")));
   cut_assert_equal_string(
     "2",
     send_command("load --table Users --columns _key\n"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index