20 #include <glib/gstdio.h>
22 #include "../lib/grn-assertions.h"
38 static gchar *tmp_directory;
54 g_free(tmp_directory);
58 remove_tmp_directory(
void)
60 cut_remove_path(tmp_directory, NULL);
66 remove_tmp_directory();
67 g_mkdir_with_parents(tmp_directory, 0700);
97 remove_tmp_directory();
127 const gchar table_name[] =
"Users";
130 path = cut_build_path(tmp_directory,
"database.groonga", NULL);
148 strlen(table_name)));
154 const gchar table_name[] =
"<users>";
157 path = cut_build_path(tmp_directory,
"database.groonga", NULL);
174 strlen(table_name)));
188 guint n_builtin_objects = 255;
189 const gchar table_name[] =
"bookmarks";
193 cut_assert_equal_uint(n_builtin_objects,
grn_table_size(context, database));
203 cut_assert_equal_uint(n_builtin_objects + 1,
213 path = cut_build_path(tmp_directory,
"database.groonga", NULL);
217 cut_assert_equal_string(
"[[[1],[[\"_key\",\"ShortText\"]],[\"groonga.org\"]]]",
224 cut_assert_equal_string(
"[[[0],[[\"_key\",\"ShortText\"]]]]",
232 gint
i, n_tries = 100;
235 cut_omit(
"will be SEGVed.");
236 path = cut_build_path(tmp_directory,
"database.groonga", NULL);
237 for (i = 0; i < n_tries; i++) {
238 gint j, n_records = 100;
248 for (j = 0; j < n_records; j++) {
251 command = g_strdup_printf(
"load '"
252 "[[\"_key\", \"point\"],"
253 "[\"http://groonga.org/version/%d\",%d]]' "
268 query, strlen(query),
279 remove_tmp_directory();
280 g_mkdir_with_parents(tmp_directory, 0700);
291 const gchar *short_text_type_name =
"ShortText";
297 short_text_type_name,
298 strlen(short_text_type_name)));
315 path = cut_build_path(tmp_directory,
"database.groonga", NULL);