[Pkg-owncloud-commits] [owncloud-client] 426/484: Test syncjournaldb: Fix comparison of two QDateTime objects.

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit aaa5c1bc5ff7972f5a16eb5f7cbac2aa0d744c11
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Nov 25 21:13:50 2015 +0100

    Test syncjournaldb: Fix comparison of two QDateTime objects.
    
    Only compare full seconds as milliseconds may float.
---
 test/testsyncjournaldb.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/testsyncjournaldb.h b/test/testsyncjournaldb.h
index 1f9ee6d..c869a32 100644
--- a/test/testsyncjournaldb.h
+++ b/test/testsyncjournaldb.h
@@ -99,9 +99,20 @@ private slots:
             record._remotePerm = "744";
             record._contentChecksum = "mychecksum";
             record._contentChecksumType = "MD5";
+            record._modtime = QDateTime::currentDateTime();
             QVERIFY(_db.setFileRecord(record));
 
             SyncJournalFileRecord storedRecord = _db.getFileRecord("foo-checksum");
+            QVERIFY(storedRecord._path == record._path);
+            QVERIFY(storedRecord._remotePerm == record._remotePerm);
+            QVERIFY(storedRecord._contentChecksum == record._contentChecksum);
+            QVERIFY(storedRecord._contentChecksumType == record._contentChecksumType);
+
+            // qDebug()<< "OOOOO " << storedRecord._modtime.toTime_t() << record._modtime.toTime_t();
+
+            // Attention: compare time_t types here, as QDateTime seem to maintain
+            // milliseconds internally, which disappear in sqlite. Go for full seconds here.
+            QVERIFY(storedRecord._modtime.toTime_t() == record._modtime.toTime_t());
             QVERIFY(storedRecord == record);
         }
         {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list