[Groonga-commit] groonga/groonga [master] test table_list: migrate to grntest from Cutter

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Fri Dec 21 11:53:10 JST 2012


Kouhei Sutou	2012-12-21 11:53:10 +0900 (Fri, 21 Dec 2012)

  New Revision: 02fdac1e907c59d033646453b425cca6e87e61f1
  https://github.com/groonga/groonga/commit/02fdac1e907c59d033646453b425cca6e87e61f1

  Log:
    test table_list: migrate to grntest from Cutter

  Added files:
    test/command/suite/table_list/multi_tables_xml.expected
    test/command/suite/table_list/multi_tables_xml.test
  Removed files:
    test/unit/core/test-command-table-list.c
  Modified files:
    test/unit/core/Makefile.am

  Added: test/command/suite/table_list/multi_tables_xml.expected (+64 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/table_list/multi_tables_xml.expected    2012-12-21 11:53:10 +0900 (aecacd0)
@@ -0,0 +1,64 @@
+table_create Sites TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Bookmarks TABLE_PAT_KEY ShortText Object
+[[0,0.0,0.0],true]
+table_create Tweets TABLE_NO_KEY
+[[0,0.0,0.0],true]
+table_list --output_type xml
+<?xml version="1.0" encoding="utf-8"?>
+<RESULT CODE="0" UP="0.0" ELAPSED="0.0">
+<TABLE_LIST>
+<HEADER>
+<PROPERTY>
+<TEXT>id</TEXT>
+<TEXT>UInt32</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>name</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>path</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>flags</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>domain</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>range</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>default_tokenizer</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY>
+<PROPERTY>
+<TEXT>normalizer</TEXT>
+<TEXT>ShortText</TEXT></PROPERTY></HEADER>
+<TABLE>
+<INT>257</INT>
+<TEXT>Bookmarks</TEXT>
+<TEXT>db/db.0000101</TEXT>
+<TEXT>TABLE_PAT_KEY|PERSISTENT</TEXT>
+<TEXT>ShortText</TEXT>
+<TEXT>Object</TEXT>
+<NULL/>
+<NULL/></TABLE>
+<TABLE>
+<INT>256</INT>
+<TEXT>Sites</TEXT>
+<TEXT>db/db.0000100</TEXT>
+<TEXT>TABLE_HASH_KEY|PERSISTENT</TEXT>
+<TEXT>ShortText</TEXT>
+<NULL/>
+<NULL/>
+<NULL/></TABLE>
+<TABLE>
+<INT>258</INT>
+<TEXT>Tweets</TEXT>
+<TEXT>db/db.0000102</TEXT>
+<TEXT>TABLE_NO_KEY|PERSISTENT</TEXT>
+<NULL/>
+<NULL/>
+<NULL/>
+<NULL/></TABLE></TABLE_LIST>
+</RESULT>
+

  Added: test/command/suite/table_list/multi_tables_xml.test (+5 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/table_list/multi_tables_xml.test    2012-12-21 11:53:10 +0900 (a1fe330)
@@ -0,0 +1,5 @@
+table_create Sites TABLE_HASH_KEY ShortText
+table_create Bookmarks TABLE_PAT_KEY ShortText Object
+table_create Tweets TABLE_NO_KEY
+
+table_list --output_type xml

  Modified: test/unit/core/Makefile.am (+0 -2)
===================================================================
--- test/unit/core/Makefile.am    2012-12-21 11:50:45 +0900 (ab52259)
+++ test/unit/core/Makefile.am    2012-12-21 11:53:10 +0900 (99c6e9d)
@@ -44,7 +44,6 @@ noinst_LTLIBRARIES =				\
 	test-inspect.la				\
 	test-command-load.la			\
 	test-command-table-create.la		\
-	test-command-table-list.la		\
 	test-command-table-rename.la		\
 	test-command-column-create.la		\
 	test-command-column-rename.la		\
@@ -135,7 +134,6 @@ test_table_sort_key_from_str_la_SOURCES	= test-table-sort-key-from-str.c
 test_inspect_la_SOURCES			= test-inspect.c
 test_command_load_la_SOURCES		= test-command-load.c
 test_command_table_create_la_SOURCES	= test-command-table-create.c
-test_command_table_list_la_SOURCES	= test-command-table-list.c
 test_command_table_rename_la_SOURCES	= test-command-table-rename.c
 test_command_column_create_la_SOURCES	= test-command-column-create.c
 test_command_column_rename_la_SOURCES	= test-command-column-rename.c

  Deleted: test/unit/core/test-command-table-list.c (+0 -131) 100644
===================================================================
--- test/unit/core/test-command-table-list.c    2012-12-21 11:50:45 +0900 (ec7c830)
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- c-basic-offset: 2; coding: utf-8 -*- */
-/*
-  Copyright (C) 2010  Kouhei Sutou <kou �� clear-code.com>
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License version 2.1 as published by the Free Software Foundation.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include <gcutter.h>
-#include <glib/gstdio.h>
-
-#include "../lib/grn-assertions.h"
-
-#include <str.h>
-
-#define get(name) grn_ctx_get(context, name, strlen(name))
-
-void test_xml(void);
-
-static gchar *tmp_directory;
-static const gchar *database_path;
-
-static grn_ctx *context;
-static grn_obj *database;
-
-void
-cut_startup(void)
-{
-  tmp_directory = g_build_filename(grn_test_get_tmp_dir(),
-                                   "table-list",
-                                   NULL);
-}
-
-void
-cut_shutdown(void)
-{
-  g_free(tmp_directory);
-}
-
-static void
-remove_tmp_directory(void)
-{
-  cut_remove_path(tmp_directory, NULL);
-}
-
-void
-cut_setup(void)
-{
-  remove_tmp_directory();
-  g_mkdir_with_parents(tmp_directory, 0700);
-
-  context = g_new0(grn_ctx, 1);
-  grn_ctx_init(context, 0);
-
-  database_path = cut_build_path(tmp_directory, "database.groonga", NULL);
-  database = grn_db_create(context, database_path, NULL);
-}
-
-void
-cut_teardown(void)
-{
-  grn_obj_close(context, database);
-  grn_ctx_fin(context);
-  g_free(context);
-
-  remove_tmp_directory();
-}
-
-void
-test_xml(void)
-{
-  assert_send_command("table_create Users TABLE_HASH_KEY ShortText");
-  assert_send_command("table_create Sites TABLE_PAT_KEY ShortText");
-  assert_send_command("table_create Tweets TABLE_NO_KEY");
-  cut_assert_equal_string(
-      cut_take_printf("<TABLE_LIST>\n"
-                      "<HEADER>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>id</TEXT>\n"
-                      "<TEXT>UInt32</TEXT></PROPERTY>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>name</TEXT>\n"
-                      "<TEXT>ShortText</TEXT></PROPERTY>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>path</TEXT>\n"
-                      "<TEXT>ShortText</TEXT></PROPERTY>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>flags</TEXT>\n"
-                      "<TEXT>ShortText</TEXT></PROPERTY>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>domain</TEXT>\n"
-                      "<TEXT>ShortText</TEXT></PROPERTY>\n"
-                      "<PROPERTY>\n"
-                      "<TEXT>range</TEXT>\n"
-                      "<TEXT>ShortText</TEXT></PROPERTY></HEADER>\n"
-                      "<TABLE>\n"
-                      "<INT>%u</INT>\n"
-                      "<TEXT>Sites</TEXT>\n"
-                      "<TEXT>%s.0000101</TEXT>\n"
-                      "<TEXT>TABLE_PAT_KEY|PERSISTENT</TEXT>\n"
-                      "<TEXT>ShortText</TEXT>\n"
-                      "<TEXT>null</TEXT></TABLE>\n"
-                      "<TABLE>\n"
-                      "<INT>%u</INT>\n"
-                      "<TEXT>Tweets</TEXT>\n"
-                      "<TEXT>%s.0000102</TEXT>\n"
-                      "<TEXT>TABLE_NO_KEY|PERSISTENT</TEXT>\n"
-                      "<TEXT>null</TEXT>\n"
-                      "<TEXT>null</TEXT></TABLE>\n"
-                      "<TABLE>\n"
-                      "<INT>%u</INT>\n"
-                      "<TEXT>Users</TEXT>\n"
-                      "<TEXT>%s.0000100</TEXT>\n"
-                      "<TEXT>TABLE_HASH_KEY|PERSISTENT</TEXT>\n"
-                      "<TEXT>ShortText</TEXT>\n"
-                      "<TEXT>null</TEXT></TABLE></TABLE_LIST>",
-                      grn_obj_id(context, get("Sites")), database_path,
-                      grn_obj_id(context, get("Tweets")), database_path,
-                      grn_obj_id(context, get("Users")), database_path),
-      send_command("table_list --output_type xml"));
-}
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index