[Groonga-commit] groonga/groonga [master] fix a bug (wrong temporary file paths).

Back to archive index

null+****@clear***** null+****@clear*****
2011年 11月 11日 (金) 14:33:06 JST


Susumu Yata	2011-11-11 05:33:06 +0000 (Fri, 11 Nov 2011)

  New Revision: 215de0caf85574e054946822b295aecb82b9bdff

  Log:
    fix a bug (wrong temporary file paths).

  Modified files:
    test/unit/core/dat/test-file.cpp
    test/unit/core/dat/test-trie.cpp

  Modified: test/unit/core/dat/test-file.cpp (+4 -4)
===================================================================
--- test/unit/core/dat/test-file.cpp    2011-11-11 05:28:31 +0000 (ad57203)
+++ test/unit/core/dat/test-file.cpp    2011-11-11 05:33:06 +0000 (2092b83)
@@ -74,8 +74,8 @@ namespace test_dat_file
   void test_create_with_path(void)
   {
     char path[PATH_MAX];
-    strcpy(path, base_dir);
-    strcat(path, "test_create_with_path.dat");
+    std::strcpy(path, base_dir);
+    std::strcat(path, "/test_create_with_path.dat");
 
     grn::dat::File file;
 
@@ -99,8 +99,8 @@ namespace test_dat_file
   void test_open(void)
   {
     char path[PATH_MAX];
-    strcpy(path, base_dir);
-    strcat(path, "test_open.dat");
+    std::strcpy(path, base_dir);
+    std::strcat(path, "/test_open.dat");
 
     grn::dat::File file;
 

  Modified: test/unit/core/dat/test-trie.cpp (+4 -2)
===================================================================
--- test/unit/core/dat/test-trie.cpp    2011-11-11 05:28:31 +0000 (7eca207)
+++ test/unit/core/dat/test-trie.cpp    2011-11-11 05:33:06 +0000 (ddb267f)
@@ -69,6 +69,7 @@ namespace test_dat_trie
     base_dir = grn_test_get_tmp_dir();
     cut_remove_path(base_dir, NULL);
     g_mkdir_with_parents(base_dir, 0755);
+std::cerr << "setup: " << base_dir << std::endl;
   }
 
   void cut_teardown(void)
@@ -76,6 +77,7 @@ namespace test_dat_trie
     if (base_dir) {
       cut_remove_path(base_dir, NULL);
     }
+std::cerr << "teardown: " << base_dir << std::endl;
   }
 
   void test_empty_trie(void)
@@ -120,7 +122,7 @@ namespace test_dat_trie
   {
     char trie_path[PATH_MAX];
     std::strcpy(trie_path, base_dir);
-    std::strcat(trie_path, "test_trie_on_file.dat");
+    std::strcat(trie_path, "/test_trie_on_file.dat");
 
     std::vector<std::string> keys;
     create_keys(&keys, 1000, 1, 16);
@@ -330,7 +332,7 @@ namespace test_dat_trie
     Keyset keyset;
     Stack stack;
     std::string str;
-    for (std::size_t i = 0; i < (1 << 16); ++i) {
+    for (std::size_t i = 0; i < 10000; ++i) {
       create_key(&str, 3, 6);
       switch (static_cast<int>(4.0 * std::rand() / RAND_MAX)) {
         case 0: {




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