[Groonga-commit] groonga/grnxx at 80bb180 [master] Fix bugs in tests that conditions for assertions were wrong.

Back to archive index

susumu.yata null+****@clear*****
Tue Sep 16 10:07:40 JST 2014


susumu.yata	2014-09-16 10:07:40 +0900 (Tue, 16 Sep 2014)

  New Revision: 80bb1801828854955ff918f77092dd846fddeffb
  https://github.com/groonga/grnxx/commit/80bb1801828854955ff918f77092dd846fddeffb

  Message:
    Fix bugs in tests that conditions for assertions were wrong.

  Modified files:
    test/test_index.cpp

  Modified: test/test_index.cpp (+5 -5)
===================================================================
--- test/test_index.cpp    2014-09-16 09:38:48 +0900 (a0317f1)
+++ test/test_index.cpp    2014-09-16 10:07:40 +0900 (25ea14f)
@@ -100,7 +100,7 @@ void test_set_and_index() {
   grnxx::Array<grnxx::Record> records;
   assert(cursor->read_all(&error, &records) == NUM_ROWS);
   for (grnxx::Int i = 1; i < NUM_ROWS; ++i) {
-    assert(values[records.get_row_id(i)] <= values[records.get_row_id(i)]);
+    assert(values[records.get_row_id(i - 1)] <= values[records.get_row_id(i)]);
   }
 }
 
@@ -149,7 +149,7 @@ void test_index_and_set() {
   grnxx::Array<grnxx::Record> records;
   assert(cursor->read_all(&error, &records) == NUM_ROWS);
   for (grnxx::Int i = 1; i < NUM_ROWS; ++i) {
-    assert(values[records.get_row_id(i)] <= values[records.get_row_id(i)]);
+    assert(values[records.get_row_id(i - 1)] <= values[records.get_row_id(i)]);
   }
 }
 
@@ -204,7 +204,7 @@ void test_remove() {
   grnxx::Array<grnxx::Record> records;
   assert(cursor->read_all(&error, &records) == (NUM_ROWS / 2));
   for (grnxx::Int i = 1; i < (NUM_ROWS / 2); ++i) {
-    assert(values[records.get_row_id(i)] <= values[records.get_row_id(i)]);
+    assert(values[records.get_row_id(i - 1)] <= values[records.get_row_id(i)]);
   }
 }
 
@@ -315,7 +315,7 @@ void test_range() {
   grnxx::Array<grnxx::Record> records;
   assert(cursor->read_all(&error, &records) != -1);
   for (grnxx::Int i = 1; i < records.size(); ++i) {
-    assert(values[records.get_row_id(i)] <= values[records.get_row_id(i)]);
+    assert(values[records.get_row_id(i - 1)] <= values[records.get_row_id(i)]);
   }
 
   grnxx::Int count = 0;
@@ -377,7 +377,7 @@ void test_reverse() {
   grnxx::Array<grnxx::Record> records;
   assert(cursor->read_all(&error, &records) != -1);
   for (grnxx::Int i = 1; i < records.size(); ++i) {
-    assert(values[records.get_row_id(i)] >= values[records.get_row_id(i)]);
+    assert(values[records.get_row_id(i - 1)] >= values[records.get_row_id(i)]);
   }
 
   grnxx::Int count = 0;
-------------- next part --------------
HTML����������������������������...
Download 



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