[Groonga-commit] groonga/groonga [master] [test] fix wrong value type for NULL.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 12月 20日 (火) 10:19:20 JST


Kouhei Sutou	2011-12-20 01:19:20 +0000 (Tue, 20 Dec 2011)

  New Revision: 921dc9bfe50ed862ea04b67aad190236e8e947c3

  Log:
    [test] fix wrong value type for NULL.

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

  Modified: test/unit/core/test-table-select.c (+5 -3)
===================================================================
--- test/unit/core/test-table-select.c    2011-12-20 01:09:37 +0000 (9b9ba8a)
+++ test/unit/core/test-table-select.c    2011-12-20 01:19:20 +0000 (32f55d1)
@@ -30,7 +30,7 @@ static gchar *path;
 static grn_ctx context;
 static grn_obj *database;
 static grn_obj *cond, *res, *expr;
-static grn_obj textbuf, intbuf;
+static grn_obj textbuf, intbuf, ptrbuf;
 
 void test_equal(void);
 void test_equal_indexed(void);
@@ -72,6 +72,7 @@ cut_setup(void)
 
   GRN_TEXT_INIT(&textbuf, 0);
   GRN_UINT32_INIT(&intbuf, 0);
+  GRN_PTR_INIT(&ptrbuf, 0, GRN_ID_NIL);
 }
 
 void
@@ -79,6 +80,7 @@ cut_teardown(void)
 {
   grn_obj_close(&context, &textbuf);
   grn_obj_close(&context, &intbuf);
+  grn_obj_close(&context, &ptrbuf);
 
   if (res)
     grn_obj_close(&context, res);
@@ -442,8 +444,8 @@ test_select_search(void)
   GRN_UINT32_SET(&context, &intbuf, GRN_TABLE_HASH_KEY|GRN_OBJ_WITH_SUBREC);
   grn_expr_append_const(&context, expr, &intbuf, GRN_OP_PUSH, 1);
   grn_expr_append_obj(&context, expr, docs, GRN_OP_PUSH, 1);
-  GRN_UINT32_SET(&context, &intbuf, 0);
-  grn_expr_append_const(&context, expr, &intbuf, GRN_OP_PUSH, 1);
+  GRN_PTR_SET(&context, &ptrbuf, NULL);
+  grn_expr_append_obj(&context, expr, &ptrbuf, GRN_OP_PUSH, 1);
   grn_expr_append_op(&context, expr, GRN_OP_TABLE_CREATE, 4);
 
   grn_expr_append_op(&context, expr, GRN_OP_ASSIGN, 2);




Groonga-commit メーリングリストの案内
Back to archive index