[Groonga-commit] groonga/grnxx [master] Add tests for open() of Map family.

Back to archive index

susumu.yata null+****@clear*****
Wed Feb 20 14:19:56 JST 2013


susumu.yata	2013-02-20 14:19:56 +0900 (Wed, 20 Feb 2013)

  New Revision: 5d51b80a885053a4b2d3cdf430ede4211ae221af
  https://github.com/groonga/grnxx/commit/5d51b80a885053a4b2d3cdf430ede4211ae221af

  Log:
    Add tests for open() of Map family.

  Modified files:
    test/test_map.cpp
    test/test_map_da_basic_trie.cpp
    test/test_map_da_large_trie.cpp
    test/test_map_double_array.cpp

  Modified: test/test_map.cpp (+3 -0)
===================================================================
--- test/test_map.cpp    2013-02-20 14:19:35 +0900 (bf25408)
+++ test/test_map.cpp    2013-02-20 14:19:56 +0900 (6aca248)
@@ -54,6 +54,9 @@ void test_basics() {
     assert(key_id == static_cast<std::int64_t>(i));
   }
 
+  const std::uint32_t block_id = map->block_id();
+  map.reset(grnxx::Map::open(pool, block_id));
+
   for (std::size_t i = 0; i < keys.size(); ++i) {
     assert(!map->insert(keys[i]));
   }

  Modified: test/test_map_da_basic_trie.cpp (+3 -0)
===================================================================
--- test/test_map_da_basic_trie.cpp    2013-02-20 14:19:35 +0900 (66155b1)
+++ test/test_map_da_basic_trie.cpp    2013-02-20 14:19:56 +0900 (2f9922f)
@@ -54,6 +54,9 @@ void test_basics() {
     assert(key_id == static_cast<std::int64_t>(i));
   }
 
+  const std::uint32_t block_id = trie->block_id();
+  trie.reset(grnxx::map::da::basic::Trie::open(pool, block_id));
+
   for (std::size_t i = 0; i < keys.size(); ++i) {
     assert(!trie->insert(keys[i]));
   }

  Modified: test/test_map_da_large_trie.cpp (+3 -0)
===================================================================
--- test/test_map_da_large_trie.cpp    2013-02-20 14:19:35 +0900 (586d177)
+++ test/test_map_da_large_trie.cpp    2013-02-20 14:19:56 +0900 (95b807b)
@@ -54,6 +54,9 @@ void test_basics() {
     assert(key_id == static_cast<std::int64_t>(i));
   }
 
+  const std::uint32_t block_id = trie->block_id();
+  trie.reset(grnxx::map::da::large::Trie::open(pool, block_id));
+
   for (std::size_t i = 0; i < keys.size(); ++i) {
     assert(!trie->insert(keys[i]));
   }

  Modified: test/test_map_double_array.cpp (+6 -3)
===================================================================
--- test/test_map_double_array.cpp    2013-02-20 14:19:35 +0900 (c733ea8)
+++ test/test_map_double_array.cpp    2013-02-20 14:19:56 +0900 (0e589a1)
@@ -54,6 +54,9 @@ void test_basics() {
     assert(key_id == static_cast<std::int64_t>(i));
   }
 
+  const std::uint32_t block_id = da->block_id();
+  da.reset(grnxx::map::DoubleArray::open(pool, block_id));
+
   for (std::size_t i = 0; i < keys.size(); ++i) {
     assert(!da->insert(keys[i]));
   }
@@ -155,7 +158,7 @@ void create_keys(std::size_t num_keys,
 }
 
 void test_insert() {
-  constexpr std::size_t NUM_KEYS = 1 << 16;
+  constexpr std::size_t NUM_KEYS = 1 << 15;
   constexpr std::size_t MIN_SIZE = 1;
   constexpr std::size_t MAX_SIZE = 10;
 
@@ -196,7 +199,7 @@ void test_insert() {
 }
 
 void test_remove() {
-  constexpr std::size_t NUM_KEYS = 1 << 16;
+  constexpr std::size_t NUM_KEYS = 1 << 15;
   constexpr std::size_t MIN_SIZE = 1;
   constexpr std::size_t MAX_SIZE = 10;
 
@@ -252,7 +255,7 @@ void test_remove() {
 }
 
 void test_update() {
-  constexpr std::size_t NUM_KEYS = 1 << 16;
+  constexpr std::size_t NUM_KEYS = 1 << 15;
   constexpr std::size_t MIN_SIZE = 1;
   constexpr std::size_t MAX_SIZE = 10;
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index