You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/02/10 15:21:43 UTC
[2/8] ignite git commit: IGNITE-2495: Added cursor test.
IGNITE-2495: Added cursor test.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ac0b59ff
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ac0b59ff
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ac0b59ff
Branch: refs/heads/ignite-1786
Commit: ac0b59ff8cfd0ae0ec9fb82aa10972078952065a
Parents: 8c0c675
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 28 17:33:52 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 28 17:33:52 2016 +0300
----------------------------------------------------------------------
.../platforms/cpp/odbc-test/src/cursor_test.cpp | 54 ++++++++++++++++++++
1 file changed, 54 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/ac0b59ff/modules/platforms/cpp/odbc-test/src/cursor_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/cursor_test.cpp b/modules/platforms/cpp/odbc-test/src/cursor_test.cpp
index af841e7..193f694 100644
--- a/modules/platforms/cpp/odbc-test/src/cursor_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/cursor_test.cpp
@@ -163,4 +163,58 @@ BOOST_AUTO_TEST_CASE(TestCursorUpdate)
CheckCursorEnd(cursor);
}
+BOOST_AUTO_TEST_CASE(TestCursorUpdateOneRow)
+{
+ Cursor cursor(testQueryId);
+
+ std::auto_ptr<ResultPage> resultPage = CreateTestPage(false, 1);
+
+ cursor.UpdateData(resultPage);
+
+ BOOST_REQUIRE(cursor.GetQueryId() == testQueryId);
+
+ CheckCursorNeedUpdate(cursor);
+
+ BOOST_REQUIRE(!cursor.Increment());
+
+ resultPage = CreateTestPage(true, 1);
+
+ cursor.UpdateData(resultPage);
+
+ CheckCursorEnd(cursor);
+
+ BOOST_REQUIRE(!cursor.Increment());
+}
+
+BOOST_AUTO_TEST_CASE(TestCursorUpdateTwoRows)
+{
+ Cursor cursor(testQueryId);
+
+ std::auto_ptr<ResultPage> resultPage = CreateTestPage(false, 2);
+
+ cursor.UpdateData(resultPage);
+
+ BOOST_REQUIRE(cursor.GetQueryId() == testQueryId);
+
+ CheckCursorReady(cursor);
+
+ BOOST_REQUIRE(cursor.Increment());
+
+ CheckCursorNeedUpdate(cursor);
+
+ BOOST_REQUIRE(!cursor.Increment());
+
+ resultPage = CreateTestPage(true, 2);
+
+ cursor.UpdateData(resultPage);
+
+ CheckCursorReady(cursor);
+
+ BOOST_REQUIRE(cursor.Increment());
+
+ CheckCursorEnd(cursor);
+
+ BOOST_REQUIRE(!cursor.Increment());
+}
+
BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file