[Groonga-commit] groonga/groonga [master] fixed wrong handling of grn_obj.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 11月 15日 (火) 11:29:59 JST


Susumu Yata	2011-11-15 02:29:59 +0000 (Tue, 15 Nov 2011)

  New Revision: d432c4901b97a7939caa121954c62045eb2f70af

  Log:
    fixed wrong handling of grn_obj.

  Modified files:
    test/unit/core/dat/test-dat.cpp

  Modified: test/unit/core/dat/test-dat.cpp (+3 -4)
===================================================================
--- test/unit/core/dat/test-dat.cpp    2011-11-15 01:57:39 +0000 (9abc2f3)
+++ test/unit/core/dat/test-dat.cpp    2011-11-15 02:29:59 +0000 (17172ce)
@@ -243,8 +243,7 @@ namespace test_dat
   void test_get_key2_with_outplace(void)
   {
     grn_obj bulk;
-    GRN_OBJ_INIT(&bulk, 0, GRN_OBJ_OUTPLACE, 0);
-    cppcut_assert_equal(GRN_SUCCESS, grn_bulk_reserve(&ctx, &bulk, 16));
+    GRN_TEXT_INIT(&bulk, 0);
 
     std::vector<std::string> keys;
     create_keys(&keys, 1000, 6, 15);
@@ -261,8 +260,8 @@ namespace test_dat
 
       GRN_BULK_REWIND(&bulk);
       cppcut_assert_equal(length, grn_dat_get_key2(&ctx, dat, key_id, &bulk));
-      cppcut_assert_equal(keys[i], std::string(bulk.u.b.head, length));
-      cppcut_assert_equal(length, static_cast<int>(bulk.u.b.curr - bulk.u.b.head));
+      cppcut_assert_equal(length, static_cast<int>(GRN_TEXT_LEN(&bulk)));
+      cppcut_assert_equal(keys[i], std::string(GRN_TEXT_VALUE(&bulk), GRN_TEXT_LEN(&bulk)));
     }
     cppcut_assert_equal(0, grn_dat_get_key2(&ctx, dat, GRN_ID_NIL, &bulk));
     cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat));




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