[Groonga-commit] groonga/grnxx at af24d4b [master] Add a test for offset and limit on multi-column sortby.

Back to archive index

susumu.yata null+****@clear*****
Fri Feb 28 12:39:40 JST 2014


susumu.yata	2014-02-28 12:39:40 +0900 (Fri, 28 Feb 2014)

  New Revision: af24d4b27888c77ad9d1f6e8c802f49d92272e34
  https://github.com/groonga/grnxx/commit/af24d4b27888c77ad9d1f6e8c802f49d92272e34

  Message:
    Add a test for offset and limit on multi-column sortby.

  Modified files:
    test/test_grnxx.cpp

  Modified: test/test_grnxx.cpp (+14 -0)
===================================================================
--- test/test_grnxx.cpp    2014-02-27 18:42:27 +0900 (83c2bb9)
+++ test/test_grnxx.cpp    2014-02-28 12:39:40 +0900 (e17a001)
@@ -675,6 +675,7 @@ void test_sorter() {
   }
 
   // Boolean, Integer, _id を基準に整列する.
+  std::vector<grnxx::RowID> answer;
   {
     std::vector<grnxx::RowID> row_ids(all_row_ids);
     std::unique_ptr<grnxx::Sorter> sorter(
@@ -694,6 +695,19 @@ void test_sorter() {
         }
       }
     }
+    answer = row_ids;
+  }
+
+  // Boolean, Integer, _id を基準に整列する.
+  {
+    std::vector<grnxx::RowID> row_ids(all_row_ids);
+    std::unique_ptr<grnxx::Sorter> sorter(
+        table->create_sorter("Boolean,-Integer,-_id"));
+    assert(sorter);
+    sorter->sort(&*row_ids.begin(), row_ids.size(), 800, 100);
+    for (grnxx::Int64 i = 800; i < 900; ++i) {
+      assert(row_ids[i] == answer[i]);
+    }
   }
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



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