[Groonga-commit] groonga/grnxx at 9c021f4 [master] Add a test for a combination of LOGICAL_NOT and brackets.

Back to archive index

susumu.yata null+****@clear*****
Wed Mar 5 14:00:18 JST 2014


susumu.yata	2014-03-05 14:00:18 +0900 (Wed, 05 Mar 2014)

  New Revision: 9c021f46ae9258d00505c3ef1b89138ea91cf890
  https://github.com/groonga/grnxx/commit/9c021f46ae9258d00505c3ef1b89138ea91cf890

  Message:
    Add a test for a combination of LOGICAL_NOT and brackets.
    
    Redmine: refs #2382.

  Modified files:
    test/test_grnxx.cpp

  Modified: test/test_grnxx.cpp (+18 -0)
===================================================================
--- test/test_grnxx.cpp    2014-03-05 12:26:17 +0900 (f566e5d)
+++ test/test_grnxx.cpp    2014-03-05 14:00:18 +0900 (2738920)
@@ -335,6 +335,24 @@ void test_calc() {
     assert(count == num_row_ids);
   }
 
+  // Integer の範囲で絞り込む.
+  {
+    std::unique_ptr<grnxx::Calc> calc(table->create_calc("!(Integer < 50)"));
+    assert(calc);
+    std::vector<grnxx::RowID> row_ids(all_row_ids);
+    grnxx::Int64 num_row_ids = calc->filter(&*row_ids.begin(), row_ids.size());
+    assert(num_row_ids != 0);
+    grnxx::Int64 count = 0;
+    for (grnxx::Int64 i = 0; i < 1000; ++i) {
+      grnxx::RowID row_id = grnxx::MIN_ROW_ID + i;
+      if (!(integer_data[i] < 50)) {
+        assert(row_ids[count] == row_id);
+        assert(++count <= num_row_ids);
+      }
+    }
+    assert(count == num_row_ids);
+  }
+
   // Boolean と Integer と Float の範囲で絞り込む.
   {
     std::unique_ptr<grnxx::Calc> calc(
-------------- next part --------------
HTML����������������������������...
Download 



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