Exemplo n.º 1
0
void
test_open_without_path(void)
{
  const gchar *saved_default_path;

  grn_test_hash_factory_set_flags(factory, 0);

  saved_default_path = cut_take_strdup(grn_test_hash_factory_get_path(factory));
  grn_test_hash_factory_set_path(factory, NULL);

  cut_assert_path_not_exist(saved_default_path);
  cut_assert_create_hash();
  cut_assert_path_not_exist(saved_default_path);
  cut_assert_fail_open_hash();
  cut_assert_path_not_exist(saved_default_path);
}
void
test_save_custom (void)
{
    GError *error = NULL;
    gchar *custom_config_path;

    custom_config_path = g_build_filename(tmp_dir,
                                          CUSTOM_CONFIG_FILE_NAME,
                                          NULL);
    cut_take_string(custom_config_path);

    milter_manager_configuration_prepend_load_path(config, tmp_dir);

    cut_assert_path_not_exist(custom_config_path);
    milter_manager_configuration_save_custom(config, "XXX", -1, &error);
    gcut_assert_error(error);
    cut_assert_path_exist(custom_config_path);
}