mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 04:08:54 +03:00
Add minor unittest for numeric id extraction #5933
This commit is contained in:
parent
48d2fc1599
commit
de7c301654
1 changed files with 13 additions and 0 deletions
|
@ -163,6 +163,19 @@ private slots:
|
|||
QVERIFY(!wipedRecord._valid);
|
||||
}
|
||||
|
||||
void testNumericId()
|
||||
{
|
||||
SyncJournalFileRecord record;
|
||||
|
||||
// Typical 8-digit padded id
|
||||
record._fileId = "00000001abcd";
|
||||
QCOMPARE(record.numericFileId(), QByteArray("00000001"));
|
||||
|
||||
// When the numeric id overflows the 8-digit boundary
|
||||
record._fileId = "123456789ocidblaabcd";
|
||||
QCOMPARE(record.numericFileId(), QByteArray("123456789"));
|
||||
}
|
||||
|
||||
private:
|
||||
SyncJournalDb _db;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue