Example #1
0
void
test_create_with_long_path(void)
{
    gssize max_size = PATH_MAX - 6;
    GString *long_path;
    const gchar last_component[] = G_DIR_SEPARATOR_S "index";

    long_path = grn_long_path_new(path, max_size - strlen(last_component) - 1);
    g_free(path);

    g_mkdir_with_parents(long_path->str, 0700);
    g_string_append(long_path, last_component);
    path = g_string_free(long_path, FALSE);

    cut_assert_equal_int(max_size, strlen(path) + 1);
    cut_assert_create();

    inverted_index_free();

    long_path = g_string_new(path);
    g_free(path);

    g_string_append(long_path, "X");
    path = g_string_free(long_path, FALSE);

    inverted_index = grn_ii_create(context, path, lexicon, 0);
    cut_assert_null(inverted_index);
}
Example #2
0
void
test_create_with_null_path(void)
{
  inverted_index = grn_ii_create(context, NULL, lexicon, 0);
  ((grn_db_obj *)inverted_index)->header.domain = GRN_DB_VOID;
  cut_assert_not_null(inverted_index);
}
Example #3
0
void
test_create_with_null_lexicon(void)
{
    inverted_index = grn_ii_create(context, path, NULL, 0);
    cut_assert_null(inverted_index);
}