[Groonga-commit] groonga/grnxx at 139e4c7 [master] Add a test for String::append(). (#75)

Back to archive index

susumu.yata null+****@clear*****
Fri Sep 26 15:30:18 JST 2014


susumu.yata	2014-09-26 15:30:18 +0900 (Fri, 26 Sep 2014)

  New Revision: 139e4c769bd51b2cbd4f99d29ab62d705fc6b661
  https://github.com/groonga/grnxx/commit/139e4c769bd51b2cbd4f99d29ab62d705fc6b661

  Message:
    Add a test for String::append(). (#75)

  Modified files:
    test/test_string.cpp

  Modified: test/test_string.cpp (+10 -0)
===================================================================
--- test/test_string.cpp    2014-09-26 15:21:50 +0900 (887897c)
+++ test/test_string.cpp    2014-09-26 15:30:18 +0900 (53efa12)
@@ -158,6 +158,16 @@ void test_string() {
              string_ends_with(strings[i], strings[j]));
     }
   }
+
+  for (grnxx::Int i = 0; i < NUM_STRINGS; ++i) {
+    std::stringstream stream;
+    stream << (i / 2.0);
+    std::string extra_string = stream.str();
+    strings[i].append(extra_string);
+    assert(bodies[i].append(&error, extra_string.data(), extra_string.size()));
+    assert(bodies[i] ==
+           grnxx::StringCRef(strings[i].data(), strings[i].size()));
+  }
 }
 
 int main() {
-------------- next part --------------
HTML����������������������������...
Download 



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