null+****@clear*****
null+****@clear*****
2012年 1月 1日 (日) 00:47:46 JST
Kouhei Sutou 2012-01-01 00:47:46 +0900 (Sun, 01 Jan 2012) New Revision: dd51aa24d242f1b2411d9b5f683b8bdcf39bba23 Log: [test] use Cutter 1.2.0. Modified files: test/unit/core/dat/test-cursor-factory.cpp test/unit/core/dat/test-dat-cursor.cpp test/unit/core/dat/test-dat-pat.cpp test/unit/core/dat/test-dat.cpp test/unit/core/dat/test-file.cpp test/unit/core/dat/test-key.cpp test/unit/core/dat/test-string.cpp test/unit/core/dat/test-trie.cpp Modified: test/unit/core/dat/test-cursor-factory.cpp (+4 -4) =================================================================== --- test/unit/core/dat/test-cursor-factory.cpp 2011-12-29 18:20:48 +0900 (3e4bc52) +++ test/unit/core/dat/test-cursor-factory.cpp 2012-01-01 00:47:46 +0900 (4063a18) @@ -48,7 +48,7 @@ namespace test_dat_cursor_factory trie, "apple", 5, "melon", 5, 1, 2, grn::dat::KEY_RANGE_CURSOR | grn::dat::EXCEPT_LOWER_BOUND | grn::dat::EXCEPT_UPPER_BOUND)); - cut_assert_not_null(cursor.get()); + cppcut_assert_not_null(cursor.get()); cppcut_assert_equal(grn::dat::UInt32(1), cursor->offset()); cppcut_assert_equal(grn::dat::UInt32(2), cursor->limit()); @@ -65,7 +65,7 @@ namespace test_dat_cursor_factory std::auto_ptr<grn::dat::Cursor> cursor(grn::dat::CursorFactory::open( trie, "apple", 5, "melon", 5, 1, 2, grn::dat::ID_RANGE_CURSOR | grn::dat::ASCENDING_CURSOR)); - cut_assert_not_null(cursor.get()); + cppcut_assert_not_null(cursor.get()); cppcut_assert_equal(grn::dat::UInt32(1), cursor->offset()); cppcut_assert_equal(grn::dat::UInt32(2), cursor->limit()); @@ -81,7 +81,7 @@ namespace test_dat_cursor_factory std::auto_ptr<grn::dat::Cursor> cursor(grn::dat::CursorFactory::open( trie, NULL, 3, "apple", 5, 0, 1, grn::dat::PREFIX_CURSOR | grn::dat::DESCENDING_CURSOR)); - cut_assert_not_null(cursor.get()); + cppcut_assert_not_null(cursor.get()); cppcut_assert_equal(grn::dat::UInt32(0), cursor->offset()); cppcut_assert_equal(grn::dat::UInt32(1), cursor->limit()); @@ -97,7 +97,7 @@ namespace test_dat_cursor_factory std::auto_ptr<grn::dat::Cursor> cursor(grn::dat::CursorFactory::open( trie, "apple", 5, NULL, 0, 1, 2, grn::dat::PREDICTIVE_CURSOR | grn::dat::EXCEPT_EXACT_MATCH)); - cut_assert_not_null(cursor.get()); + cppcut_assert_not_null(cursor.get()); cppcut_assert_equal(grn::dat::UInt32(1), cursor->offset()); cppcut_assert_equal(grn::dat::UInt32(2), cursor->limit()); Modified: test/unit/core/dat/test-dat-cursor.cpp (+42 -42) =================================================================== --- test/unit/core/dat/test-dat-cursor.cpp 2011-12-29 18:20:48 +0900 (4645e0f) +++ test/unit/core/dat/test-dat-cursor.cpp 2012-01-01 00:47:46 +0900 (3a3675f) @@ -75,7 +75,7 @@ namespace test_dat_cursor grn_dat *create_trie(const std::vector<std::string> &keys) { grn_dat * const dat = grn_dat_create(&ctx, NULL, 0, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); for (std::size_t i = 0; i < keys.size(); ++i) { const char * const ptr = keys[i].c_str(); const uint32_t length = static_cast<uint32_t>(keys[i].length()); @@ -88,10 +88,10 @@ namespace test_dat_cursor void test_cursor_open(void) { grn_dat *dat = grn_dat_create(&ctx, NULL, 0, 0, 0); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); grn_dat_cursor *cursor = grn_dat_cursor_open(&ctx, dat, "ABC", 0, "XYZ", 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); grn_dat_cursor_close(&ctx, cursor); cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat)); @@ -99,7 +99,7 @@ namespace test_dat_cursor create_keys(&keys, 100, 3, 5); dat = create_trie(keys); cursor = grn_dat_cursor_open(&ctx, dat, "ABC", 0, "XYZ", 0, 0, -1, GRN_CURSOR_BY_KEY); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); grn_dat_cursor_close(&ctx, cursor); cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat)); } @@ -112,7 +112,7 @@ namespace test_dat_cursor grn_dat_cursor * const cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); for (std::size_t i = 1; i <= keys.size(); ++i) { cppcut_assert_equal(static_cast<grn_id>(i), grn_dat_cursor_next(&ctx, cursor)); } @@ -130,7 +130,7 @@ namespace test_dat_cursor grn_dat_cursor * const cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); for (std::size_t i = 0; i < keys.size(); ++i) { const grn_id key_id = static_cast<grn_id>(i + 1); const int length = static_cast<int>(keys[i].length()); @@ -155,7 +155,7 @@ namespace test_dat_cursor grn_dat_cursor *cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); for (std::size_t i = 1; i <= keys.size(); ++i) { cppcut_assert_equal(static_cast<grn_id>(i), grn_dat_cursor_next(&ctx, cursor)); if (i & 1) { @@ -166,7 +166,7 @@ namespace test_dat_cursor grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); for (std::size_t i = 1; i <= (keys.size() / 2); ++i) { cppcut_assert_equal(static_cast<grn_id>(i * 2), grn_dat_cursor_next(&ctx, cursor)); } @@ -187,7 +187,7 @@ namespace test_dat_cursor grn_dat_cursor *cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); @@ -197,7 +197,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[2].c_str(), keys[2].length(), NULL, 0, 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(4), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -205,7 +205,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, keys[1].c_str(), keys[1].length(), 0, -1, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -213,7 +213,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_ID); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -221,7 +221,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_ID | GRN_CURSOR_ASCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -229,7 +229,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_ID | GRN_CURSOR_DESCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -238,7 +238,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[1].c_str(), keys[1].length(), keys[2].c_str(), keys[2].length(), 0, -1, GRN_CURSOR_BY_ID | GRN_CURSOR_LT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); @@ -246,7 +246,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[1].c_str(), keys[1].length(), keys[2].c_str(), keys[2].length(), 0, -1, GRN_CURSOR_BY_ID | GRN_CURSOR_GT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); @@ -265,7 +265,7 @@ namespace test_dat_cursor grn_dat_cursor *cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 0, -1, GRN_CURSOR_BY_KEY); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(4), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); @@ -275,7 +275,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[0].c_str(), keys[0].length(), NULL, 0, 0, -1, GRN_CURSOR_BY_KEY); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -283,7 +283,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, keys[1].c_str(), keys[1].length(), 0, -1, GRN_CURSOR_BY_KEY); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(4), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -291,7 +291,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_KEY); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -299,7 +299,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_KEY | GRN_CURSOR_ASCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -307,7 +307,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, NULL, 0, 1, 2, GRN_CURSOR_BY_KEY | GRN_CURSOR_DESCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -316,7 +316,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[1].c_str(), keys[1].length(), keys[0].c_str(), keys[0].length(), 0, -1, GRN_CURSOR_BY_KEY | GRN_CURSOR_LT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); @@ -324,7 +324,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, keys[1].c_str(), keys[1].length(), keys[0].c_str(), keys[0].length(), 0, -1, GRN_CURSOR_BY_KEY | GRN_CURSOR_GT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); @@ -349,7 +349,7 @@ namespace test_dat_cursor cut_assert_null(cursor); cursor = grn_dat_cursor_open(&ctx, dat, "m", 1, NULL, 0, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(4), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); @@ -358,7 +358,7 @@ namespace test_dat_cursor grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, "min", 3, NULL, 0, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); @@ -366,7 +366,7 @@ namespace test_dat_cursor grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, "m", 1, NULL, 0, 1, 2, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -374,7 +374,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, "m", 1, NULL, 0, 1, 2, GRN_CURSOR_PREFIX | GRN_CURSOR_ASCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -382,7 +382,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, "m", 1, NULL, 0, 1, 2, GRN_CURSOR_PREFIX | GRN_CURSOR_DESCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -390,14 +390,14 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, "mind", 4, NULL, 0, 0, -1, GRN_CURSOR_PREFIX | GRN_CURSOR_LT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, "mind", 4, NULL, 0, 0, -1, GRN_CURSOR_PREFIX | GRN_CURSOR_GT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); @@ -418,10 +418,10 @@ namespace test_dat_cursor cut_assert_null(cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "", 0, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_null(cursor); + cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "note", 4, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); @@ -429,35 +429,35 @@ namespace test_dat_cursor grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "not", 3, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 3, "note", 4, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, "XYZ", 3, "note", 4, 0, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "note", 4, 1, -1, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); grn_dat_cursor_close(&ctx, cursor); cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "note", 4, 0, 2, GRN_CURSOR_PREFIX); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -465,7 +465,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "note", 4, 0, 2, GRN_CURSOR_PREFIX | GRN_CURSOR_ASCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -473,7 +473,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 0, "note", 4, 0, 2, GRN_CURSOR_PREFIX | GRN_CURSOR_DESCENDING); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(GRN_ID_NIL), grn_dat_cursor_next(&ctx, cursor)); @@ -481,7 +481,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 2, "note", 4, 0, -1, GRN_CURSOR_PREFIX | GRN_CURSOR_LT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); @@ -490,7 +490,7 @@ namespace test_dat_cursor cursor = grn_dat_cursor_open(&ctx, dat, NULL, 2, "note", 4, 0, -1, GRN_CURSOR_PREFIX | GRN_CURSOR_GT); - cut_assert_not_null(cursor); + cppcut_assert_not_null(cursor); cppcut_assert_equal(static_cast<grn_id>(3), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(1), grn_dat_cursor_next(&ctx, cursor)); cppcut_assert_equal(static_cast<grn_id>(2), grn_dat_cursor_next(&ctx, cursor)); Modified: test/unit/core/dat/test-dat-pat.cpp (+14 -14) =================================================================== --- test/unit/core/dat/test-dat-pat.cpp 2011-12-29 18:20:48 +0900 (8a9c64d) +++ test/unit/core/dat/test-dat-pat.cpp 2012-01-01 00:47:46 +0900 (66331b3) @@ -99,7 +99,7 @@ namespace test_dat_pat generate_pat_path(filename, pat_path); grn_pat * const pat = grn_pat_create(&ctx, pat_path, 1024, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(pat); + cppcut_assert_not_null(pat); for (std::size_t i = 0; i < keys.size(); ++i) { grn_pat_add(&ctx, pat, keys[i].c_str(), keys[i].length(), NULL, NULL); @@ -113,7 +113,7 @@ namespace test_dat_pat generate_dat_path(filename, dat_path); grn_dat * const dat = grn_dat_create(&ctx, dat_path, 1024, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); for (std::size_t i = 0; i < keys.size(); ++i) { grn_dat_add(&ctx, dat, keys[i].c_str(), keys[i].length(), NULL, NULL); @@ -137,8 +137,8 @@ namespace test_dat_pat grn_pat *pat = grn_pat_open(&ctx, pat_path); grn_dat *dat = grn_dat_open(&ctx, dat_path); - cut_assert_null(pat); - cut_assert_null(dat); + cppcut_assert_null(pat); + cppcut_assert_null(dat); std::vector<std::string> keys; create_keys(&keys, 1000, 3, 5); @@ -154,8 +154,8 @@ namespace test_dat_pat pat = grn_pat_open(&ctx, pat_path); dat = grn_dat_open(&ctx, dat_path); - cut_assert_not_null(pat); - cut_assert_not_null(dat); + cppcut_assert_not_null(pat); + cppcut_assert_not_null(dat); cppcut_assert_equal(GRN_SUCCESS, grn_pat_close(&ctx, pat)); cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat)); @@ -378,12 +378,12 @@ namespace test_dat_pat grn_pat_cursor * const pat_cursor = grn_pat_cursor_open(&ctx, pat, min_key, min_length, max_key, max_length, offset, limit, flags); - cut_assert_not_null(pat_cursor); + cppcut_assert_not_null(pat_cursor); grn_dat_cursor * const dat_cursor = grn_dat_cursor_open(&ctx, dat, min_key, min_length, max_key, max_length, offset, limit, flags); - cut_assert_not_null(dat_cursor); + cppcut_assert_not_null(dat_cursor); grn_id pat_id; grn_id dat_id; @@ -437,7 +437,7 @@ namespace test_dat_pat disables_max ? NULL : max_str.c_str(), disables_max ? 0 : max_str.length(), offset, limit, flags); - cut_assert_not_null(pat_cursor); + cppcut_assert_not_null(pat_cursor); grn_dat_cursor * const dat_cursor = grn_dat_cursor_open(&ctx, dat, disables_min ? NULL : min_str.c_str(), @@ -445,7 +445,7 @@ namespace test_dat_pat disables_max ? NULL : max_str.c_str(), disables_max ? 0 : max_str.length(), offset, limit, flags); - cut_assert_not_null(dat_cursor); + cppcut_assert_not_null(dat_cursor); grn_id pat_id; grn_id dat_id; @@ -490,12 +490,12 @@ namespace test_dat_pat grn_pat_cursor * const pat_cursor = grn_pat_cursor_open(&ctx, pat, NULL, min_length, max_str.c_str(), max_str.length(), offset, limit, flags); - cut_assert_not_null(pat_cursor); + cppcut_assert_not_null(pat_cursor); grn_dat_cursor * const dat_cursor = grn_dat_cursor_open(&ctx, dat, NULL, min_length, max_str.c_str(), max_str.length(), offset, limit, flags); - cut_assert_not_null(dat_cursor); + cppcut_assert_not_null(dat_cursor); grn_id pat_id; grn_id dat_id; @@ -538,12 +538,12 @@ namespace test_dat_pat grn_pat_cursor * const pat_cursor = grn_pat_cursor_open(&ctx, pat, min_str.c_str(), min_str.length(), NULL, 0, offset, limit, flags); - cut_assert_not_null(pat_cursor); + cppcut_assert_not_null(pat_cursor); grn_dat_cursor *dat_cursor = grn_dat_cursor_open(&ctx, dat, min_str.c_str(), min_str.length(), NULL, 0, offset, limit, flags); - cut_assert_not_null(dat_cursor); + cppcut_assert_not_null(dat_cursor); grn_id pat_id; grn_id dat_id; Modified: test/unit/core/dat/test-dat.cpp (+13 -12) =================================================================== --- test/unit/core/dat/test-dat.cpp 2011-12-29 18:20:48 +0900 (1e02f80) +++ test/unit/core/dat/test-dat.cpp 2012-01-01 00:47:46 +0900 (0f58e23) @@ -84,13 +84,14 @@ namespace test_dat grn_dat *create_trie(const std::vector<std::string> &keys, const char *path) { grn_dat * const dat = grn_dat_create(&ctx, path, 0, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); for (std::size_t i = 0; i < keys.size(); ++i) { const char * const ptr = keys[i].c_str(); const uint32_t length = static_cast<uint32_t>(keys[i].length()); int added; const grn_id key_id = grn_dat_add(&ctx, dat, ptr, length, NULL, &added); - cut_assert(key_id != GRN_ID_NIL); + cppcut_assert_not_equal(static_cast<const grn_id>(GRN_ID_NIL), + key_id); cut_assert_true(added); } return dat; @@ -130,7 +131,7 @@ namespace test_dat grn_dat * const dat = create_trie(keys, dat_path); grn_dat * const dat2 = grn_dat_open(&ctx, dat_path); - cut_assert_not_null(dat2); + cppcut_assert_not_null(dat2); for (std::size_t i = 0; i < keys.size(); ++i) { const char * const ptr = keys[i].c_str(); const uint32_t length = static_cast<uint32_t>(keys[i].length()); @@ -140,8 +141,8 @@ namespace test_dat cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat)); cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat2)); - cut_assert_null(grn_dat_open(&ctx, NULL)); - cut_assert_null(grn_dat_open(&ctx, "")); + cppcut_assert_null(grn_dat_open(&ctx, NULL)); + cppcut_assert_null(grn_dat_open(&ctx, "")); } void test_remove(void) @@ -225,7 +226,7 @@ namespace test_dat uint32_t key_length; const char * const key_ptr = _grn_dat_key(&ctx, dat, key_id, &key_length); - cut_assert_not_null(key_ptr); + cppcut_assert_not_null(key_ptr); cppcut_assert_equal(length, static_cast<int>(key_length)); cppcut_assert_equal(length, grn_dat_get_key2(&ctx, dat, key_id, &bulk)); @@ -253,7 +254,7 @@ namespace test_dat uint32_t key_length; const char * const key_ptr = _grn_dat_key(&ctx, dat, key_id, &key_length); - cut_assert_not_null(key_ptr); + cppcut_assert_not_null(key_ptr); cppcut_assert_equal(length, static_cast<int>(key_length)); GRN_BULK_REWIND(&bulk); @@ -337,7 +338,7 @@ namespace test_dat create_keys(&keys, 1000, 6, 15); grn_dat * const dat = grn_dat_create(&ctx, NULL, 0, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); for (std::size_t i = 0; i < (keys.size() / 2); ++i) { const char * const ptr = keys[i].c_str(); const uint32_t length = static_cast<uint32_t>(keys[i].length()); @@ -383,7 +384,7 @@ namespace test_dat create_keys(&keys, 1000, 6, 15); grn_dat * const dat = grn_dat_create(&ctx, NULL, 0, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); for (std::size_t i = 0; i < (keys.size() / 2); ++i) { const char * const ptr = keys[i].c_str(); const uint32_t length = static_cast<uint32_t>(keys[i].length()); @@ -478,7 +479,7 @@ namespace test_dat void test_curr_id(void) { grn_dat * const dat = grn_dat_create(&ctx, NULL, 0, 0, GRN_OBJ_KEY_VAR_SIZE); - cut_assert_not_null(dat); + cppcut_assert_not_null(dat); grn_id max_key_id = 0; std::string key; @@ -524,11 +525,11 @@ namespace test_dat const uint32_t length = static_cast<uint32_t>(keys[i].length()); uint32_t key_length; const char * const key_ptr = _grn_dat_key(&ctx, dat, key_id, &key_length); - cut_assert_not_null(key_ptr); + cppcut_assert_not_null(key_ptr); cppcut_assert_equal(length, key_length); cppcut_assert_equal(keys[i], std::string(key_ptr, key_length)); } - cut_assert_null(_grn_dat_key(&ctx, dat, GRN_ID_NIL, NULL)); + cppcut_assert_null(_grn_dat_key(&ctx, dat, GRN_ID_NIL, NULL)); cppcut_assert_equal(GRN_SUCCESS, grn_dat_close(&ctx, dat)); } Modified: test/unit/core/dat/test-file.cpp (+6 -6) =================================================================== --- test/unit/core/dat/test-file.cpp 2011-12-29 18:20:48 +0900 (0c7dff1) +++ test/unit/core/dat/test-file.cpp 2012-01-01 00:47:46 +0900 (667e50d) @@ -46,7 +46,7 @@ namespace test_dat_file { const grn::dat::File file; - cut_assert_null(file.ptr()); + cppcut_assert_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(0), file.size()); } @@ -61,7 +61,7 @@ namespace test_dat_file } file.create(NULL, 32); - cut_assert_not_null(file.ptr()); + cppcut_assert_not_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(32), file.size()); grn::dat::UInt8 * const buf = static_cast<grn::dat::UInt8 *>(file.ptr()); @@ -86,7 +86,7 @@ namespace test_dat_file } file.create(path, 32); - cut_assert_not_null(file.ptr()); + cppcut_assert_not_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(32), file.size()); grn::dat::UInt8 * const buf = static_cast<grn::dat::UInt8 *>(file.ptr()); @@ -118,7 +118,7 @@ namespace test_dat_file cppcut_assert_equal(grn::dat::UInt64(0), file.size()); file.open(path); - cut_assert_not_null(file.ptr()); + cppcut_assert_not_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(32), file.size()); cppcut_assert_equal(0, std::strcmp(static_cast<char *>(file.ptr()), "This is a pen.")); } @@ -128,7 +128,7 @@ namespace test_dat_file grn::dat::File file; file.create(NULL, 100); - cut_assert_not_null(file.ptr()); + cppcut_assert_not_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(100), file.size()); grn::dat::File file_new; @@ -137,7 +137,7 @@ namespace test_dat_file cut_assert_null(file.ptr()); cppcut_assert_equal(grn::dat::UInt64(0), file.size()); - cut_assert_not_null(file_new.ptr()); + cppcut_assert_not_null(file_new.ptr()); cppcut_assert_equal(grn::dat::UInt64(100), file_new.size()); } } Modified: test/unit/core/dat/test-key.cpp (+1 -1) =================================================================== --- test/unit/core/dat/test-key.cpp 2011-12-29 18:20:48 +0900 (e1b36d0) +++ test/unit/core/dat/test-key.cpp 2012-01-01 00:47:46 +0900 (a5da561) @@ -44,7 +44,7 @@ namespace test_dat_key cppcut_assert_equal(grn::dat::INVALID_KEY_ID, key.id()); cppcut_assert_equal(grn::dat::UInt32(0), key.length()); - cut_assert_not_null(key.ptr()); + cppcut_assert_not_null(key.ptr()); } void test_creation(void) Modified: test/unit/core/dat/test-string.cpp (+4 -4) =================================================================== --- test/unit/core/dat/test-string.cpp 2011-12-29 18:20:48 +0900 (b746638) +++ test/unit/core/dat/test-string.cpp 2012-01-01 00:47:46 +0900 (f25523a) @@ -100,10 +100,10 @@ namespace test_dat_string const grn::dat::String str("apple"); cppcut_assert_equal(0, str.compare(grn::dat::String("apple"))); - cut_assert_operator(str.compare(grn::dat::String("appl")), >, 0); - cut_assert_operator(str.compare(grn::dat::String("appleX")), <, 0); - cut_assert_operator(str.compare(grn::dat::String("banana")), <, 0); - cut_assert_operator(str.compare(grn::dat::String("and")), >, 0); + cppcut_assert_operator(str.compare(grn::dat::String("appl")), >, 0); + cppcut_assert_operator(str.compare(grn::dat::String("appleX")), <, 0); + cppcut_assert_operator(str.compare(grn::dat::String("banana")), <, 0); + cppcut_assert_operator(str.compare(grn::dat::String("and")), >, 0); } void test_starts_with(void) Modified: test/unit/core/dat/test-trie.cpp (+3 -3) =================================================================== --- test/unit/core/dat/test-trie.cpp 2011-12-29 18:20:48 +0900 (1d87132) +++ test/unit/core/dat/test-trie.cpp 2012-01-01 00:47:46 +0900 (ecba235) @@ -50,7 +50,7 @@ namespace GError *glib_error = NULL; thread_ = g_thread_create(func, data, TRUE, &glib_error); gcut_assert_error(glib_error, cut_message("g_thread_create() failed")); - cut_assert_not_null(thread_); + cppcut_assert_not_null(thread_); } void join() { @@ -402,9 +402,9 @@ namespace test_dat_trie cppcut_assert_equal(src_trie.num_keys(), dest_trie.num_keys()); cppcut_assert_equal(src_trie.next_key_pos(), dest_trie.next_key_pos()); - cut_assert_operator(dest_trie.num_nodes(), <, src_trie.num_nodes()); + cppcut_assert_operator(dest_trie.num_nodes(), <, src_trie.num_nodes()); cppcut_assert_equal(grn::dat::UInt32(0), dest_trie.num_zombies()); - cut_assert_operator(dest_trie.num_blocks(), <, src_trie.num_nodes()); + cppcut_assert_operator(dest_trie.num_blocks(), <, src_trie.num_nodes()); } void test_random_queries(void)