22 #include <glib/gstdio.h>
24 #include "../lib/grn-assertions.h"
31 static gchar *default_path;
32 static int default_context_flags;
34 static gchar *sample_ql_program;
43 default_path = g_build_filename(base_dir,
"db", NULL);
47 cut_remove_path(base_dir, NULL);
48 g_mkdir_with_parents(base_dir, 0755);
51 "..",
"ql",
"bookmark.scm", NULL);
70 cut_remove_path(base_dir, NULL);
73 if (sample_ql_program) {
74 g_free(sample_ql_program);
78 #define create_db() do \
80 grn_db_create_optarg option; \
82 option.builtin_type_names = NULL; \
83 option.n_builtin_type_names = 0; \
84 db = grn_db_create(context, default_path, &option); \
87 #define open_context() do \
89 grn_test_assert(grn_ctx_init(context, default_context_flags)); \
90 GRN_CTX_SET_ENCODING(context, default_encoding); \
93 #define cut_assert_open_context() do \
98 cut_assert(context); \