[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] add drop test with other ctx.

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:46:47 JST 2012


Tetsuro IKEDA	2009-07-21 16:27:39 +0900 (Tue, 21 Jul 2009)

  New Revision: 8a376f7079d5d3bff45ac994a9012ef4c8181fa3
  https://github.com/mroonga/mroonga/commit/8a376f7079d5d3bff45ac994a9012ef4c8181fa3

  Log:
    add drop test with other ctx.

  Modified files:
    test/unit/test-driver.c

  Modified: test/unit/test-driver.c (+31 -0)
===================================================================
--- test/unit/test-driver.c    2009-07-21 15:44:05 +0900 (2e461b6)
+++ test/unit/test-driver.c    2009-07-21 16:27:39 +0900 (c92c5bc)
@@ -297,6 +297,37 @@ void test_mrn_drop()
   mrn_deinit_obj_info(ctx, info);
 }
 
+void test_mrn_drop_from_other_ctx()
+{
+  TEST_ENTER;
+  grn_obj *obj, *obj2;
+  mrn_info *info = mrn_init_obj_info(ctx, 2);
+  grn_ctx ctx2;
+  grn_ctx_init(&ctx2,0);
+  grn_ctx_use(&ctx2, mrn_db);
+
+  info->table->name = "test/t1";
+  info->table->name_size = strlen("test/t1");
+  info->table->flags |= GRN_OBJ_TABLE_NO_KEY;
+
+  info->columns[0]->name = "c1";
+  info->columns[0]->name_size = strlen("c1");
+  info->columns[0]->flags |= GRN_OBJ_COLUMN_SCALAR;
+  info->columns[0]->type = grn_ctx_at(ctx, GRN_DB_INT32);
+
+  info->columns[1]->name = "c2";
+  info->columns[1]->name_size = strlen("c2");
+  info->columns[1]->flags |= GRN_OBJ_COLUMN_SCALAR;
+  info->columns[1]->type = grn_ctx_at(ctx, GRN_DB_TEXT);
+
+  cut_assert_equal_int(0, mrn_create(ctx, info));
+  cut_assert_equal_int(0, mrn_open(ctx, info));
+  cut_assert_equal_int(0, mrn_close(ctx, info));
+  cut_assert_equal_int(0, mrn_drop(&ctx2, "test/t1"));
+  cut_assert_equal_int(-1, mrn_open(&ctx2, info));
+  mrn_deinit_obj_info(ctx, info);
+}
+
 void test_mrn_write_row()
 {
   TEST_ENTER;
-------------- next part --------------
HTML����������������������������...
Download 



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