diff options
Diffstat (limited to 'tests/test-storage.cpp')
-rw-r--r-- | tests/test-storage.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/test-storage.cpp b/tests/test-storage.cpp index d8259e1..51a6058 100644 --- a/tests/test-storage.cpp +++ b/tests/test-storage.cpp @@ -228,13 +228,27 @@ TEST_F(StorageTest, generate_id) TEST_F(StorageTest, checksum32) { + EXPECT_EQ(checksum32(""), 0); + EXPECT_EQ(checksum32("0"), 48); + EXPECT_EQ(checksum32("\x00"), 0); + EXPECT_EQ(checksum32("123"), 1073741862); + EXPECT_EQ(checksum32("a"), 97); + EXPECT_EQ(checksum32("ab"), 82); + EXPECT_EQ(checksum32("abc"), 1073741898); +} + +TEST_F(StorageTest, db_size) +{ Storage storage(*m_config); - EXPECT_EQ(storage.checksum32(""), 0); - EXPECT_EQ(storage.checksum32("0"), 48); - EXPECT_EQ(storage.checksum32("\x00"), 0); - EXPECT_EQ(storage.checksum32("123"), 1073741862); - EXPECT_EQ(storage.checksum32("a"), 97); - EXPECT_EQ(storage.checksum32("ab"), 82); - EXPECT_EQ(storage.checksum32("abc"), 1073741898); + auto dbsize_gross{storage.dbsize_gross()}; + auto dbsize_net{storage.dbsize_net()}; + + EXPECT_LE(0, storage.dbsize_net()); + EXPECT_LE(storage.dbsize_net(), storage.dbsize_gross()); + + storage.setDocument("0", "xyz"); + + EXPECT_LE(dbsize_net, storage.dbsize_net()); + EXPECT_LE(dbsize_gross, storage.dbsize_gross()); } |