b85a01a
From 3e7b595ee9080b71930243d6e56268a2a8d08185 Mon Sep 17 00:00:00 2001
b85a01a
From: jordi fita i mas <jfita@infoblitz.com>
b85a01a
Date: Sat, 25 Apr 2020 23:00:43 +0200
b85a01a
Subject: [PATCH 08/22] Expand feature test for buffered cursors
b85a01a
MIME-Version: 1.0
b85a01a
Content-Type: text/plain; charset=UTF-8
b85a01a
Content-Transfer-Encoding: 8bit
b85a01a
b85a01a
Summary:
b85a01a
When testing a driver’s cached cursors it is interesting to see whether
b85a01a
the cursor actually can go back to the first record and then return the
b85a01a
values for all of them again.
b85a01a
b85a01a
Checking only the return value of KDbCursor::moveFirst and
b85a01a
KDbCursor::moveLast is not enough to see if it works, because they just
b85a01a
return true even though the driver does not change anything.
b85a01a
b85a01a
Reviewers: staniek, piggz
b85a01a
b85a01a
Subscribers: Kexi-Devel-list
b85a01a
b85a01a
Tags: #kdb
b85a01a
b85a01a
FIXED-IN:3.2.1
b85a01a
b85a01a
Differential Revision: https://phabricator.kde.org/D29185
b85a01a
---
b85a01a
 tests/features/cursors_test.h | 23 ++++++++++++++++++-----
b85a01a
 1 file changed, 18 insertions(+), 5 deletions(-)
b85a01a
b85a01a
diff --git a/tests/features/cursors_test.h b/tests/features/cursors_test.h
b85a01a
index 9ea968e1..5691158e 100644
b85a01a
--- a/tests/features/cursors_test.h
b85a01a
+++ b/tests/features/cursors_test.h
b85a01a
@@ -46,11 +46,24 @@ int cursorsTest()
b85a01a
     qDebug() << "KDbCursor::moveFirst() ---------------------";
b85a01a
     qDebug() << "-- KDbCursor::moveFirst() == " << cursor->moveFirst();
b85a01a
 
b85a01a
-    /*  qDebug()<<"KDbCursor::moveNext() == "<<cursor->moveNext();
b85a01a
-      qDebug()<<"KDbCursor::moveNext() == "<<cursor->moveNext();
b85a01a
-      qDebug()<<"KDbCursor::moveNext() == "<<cursor->moveNext();
b85a01a
-      qDebug()<<"KDbCursor::moveNext() == "<<cursor->moveNext();
b85a01a
-      qDebug()<<"KDbCursor::eof() == "<<cursor->eof();*/
b85a01a
+    if (cursor_options & KDbCursor::Option::Buffered) {
b85a01a
+      qDebug() << "KDbCursor Buffered -------------------------";
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::moveNext() == " << cursor->moveNext();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::moveNext() == "<< cursor->moveNext();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::moveNext() == "<< cursor->moveNext();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::moveNext() == "<< cursor->moveNext();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::movePrev() == "<< cursor->movePrev();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::moveNext() == "<< cursor->moveNext();
b85a01a
+      qDebug() << "-- KDbCursor::value(0) == " << cursor->value(0);
b85a01a
+      qDebug() << "-- KDbCursor::eof() == " << cursor->eof();
b85a01a
+    }
b85a01a
+
b85a01a
     conn->deleteCursor(cursor);
b85a01a
 
b85a01a
     return 0;
b85a01a
-- 
b85a01a
2.31.1
b85a01a