[Groonga-commit] groonga/groonga [master] do not free string from grn_test_get_tmp_dir().

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 23日 (金) 10:29:02 JST


Nobuyoshi Nakada	2010-07-23 01:29:02 +0000 (Fri, 23 Jul 2010)

  New Revision: ebc841782523f572d6b0d0519357ecbc54997572

  Log:
    do not free string from grn_test_get_tmp_dir().

  Modified files:
    test/unit/core/test-hash.h
    test/unit/core/test-patricia-trie.h
    test/unit/core/test-performance.c
    test/unit/core/test-public-context.c
    test/unit/core/test-stress.c

  Modified: test/unit/core/test-hash.h (+1 -2)
===================================================================
--- test/unit/core/test-hash.h    2010-07-23 01:08:10 +0000 (afc3db1)
+++ test/unit/core/test-hash.h    2010-07-23 01:29:02 +0000 (5ad16b3)
@@ -39,7 +39,7 @@ static uint32_t sample_key;
 static const gchar *sample_value;
 static grn_id sample_id;
 
-static gchar *base_dir;
+static const gchar *base_dir;
 
 static uint32_t key_size;
 static gchar *not_uint32_size_key;
@@ -115,7 +115,6 @@ teardown_hash_common(void)
 
   if (base_dir) {
     cut_remove_path(base_dir, NULL);
-    g_free(base_dir);
   }
 
   teardown_grn_logger(logger);

  Modified: test/unit/core/test-patricia-trie.h (+1 -2)
===================================================================
--- test/unit/core/test-patricia-trie.h    2010-07-23 01:08:10 +0000 (9ceac09)
+++ test/unit/core/test-patricia-trie.h    2010-07-23 01:29:02 +0000 (7e0ce7a)
@@ -39,7 +39,7 @@ static gchar *sample_key;
 static const gchar *sample_value;
 static grn_id sample_id;
 
-static gchar *base_dir;
+static const gchar *base_dir;
 
 static gchar *default_path;
 static uint32_t default_key_size;
@@ -144,7 +144,6 @@ teardown_trie_common(void)
 
   if (base_dir) {
     cut_remove_path(base_dir, NULL);
-    g_free(base_dir);
   }
 
   teardown_grn_logger(logger);

  Modified: test/unit/core/test-performance.c (+1 -2)
===================================================================
--- test/unit/core/test-performance.c    2010-07-23 01:08:10 +0000 (33f8040)
+++ test/unit/core/test-performance.c    2010-07-23 01:29:02 +0000 (5394c4b)
@@ -72,7 +72,7 @@ test_data_free(grn_test_data *data)
 void
 cut_setup(void)
 {
-  gchar *tmp_dir;
+  const gchar *tmp_dir;
 
   sub_processes = NULL;
   base_data = NULL;
@@ -96,7 +96,6 @@ cut_setup(void)
   cut_remove_path(tmp_dir, NULL);
 
   base_dir = g_build_filename(tmp_dir, "performance", NULL);
-  g_free(tmp_dir);
 
   g_mkdir_with_parents(base_dir, 0755);
   cut_assert_path_exist(base_dir);

  Modified: test/unit/core/test-public-context.c (+1 -2)
===================================================================
--- test/unit/core/test-public-context.c    2010-07-23 01:08:10 +0000 (1bf1a29)
+++ test/unit/core/test-public-context.c    2010-07-23 01:29:02 +0000 (c6b78c1)
@@ -27,7 +27,7 @@ void test_load(void);
 
 static grn_obj *db;
 static grn_ctx *context;
-static gchar *base_dir;
+static const gchar *base_dir;
 static gchar *default_path;
 static int default_context_flags;
 static grn_encoding default_encoding;
@@ -68,7 +68,6 @@ cut_teardown(void)
 
   if (base_dir) {
     cut_remove_path(base_dir, NULL);
-    g_free(base_dir);
   }
 
   if (sample_ql_program) {

  Modified: test/unit/core/test-stress.c (+1 -2)
===================================================================
--- test/unit/core/test-stress.c    2010-07-23 01:08:10 +0000 (0f5b5ad)
+++ test/unit/core/test-stress.c    2010-07-23 01:29:02 +0000 (e36c4a8)
@@ -43,7 +43,7 @@ static gchar *env_process_number;
 void
 cut_setup(void)
 {
-  gchar *tmp_dir;
+  const gchar *tmp_dir;
 
   context = g_new0(grn_ctx, 1);
   hash = NULL;
@@ -64,7 +64,6 @@ cut_setup(void)
   cut_remove_path(tmp_dir, NULL);
 
   base_dir = g_build_filename(tmp_dir, "stress", NULL);
-  g_free(tmp_dir);
 
   g_mkdir_with_parents(base_dir, 0755);
   cut_assert_path_exist(base_dir);




Groonga-commit メーリングリストの案内
Back to archive index