summaryrefslogtreecommitdiffhomepage
path: root/tests/test-storage.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-02-04 12:43:51 +0100
committerRoland Reichwein <mail@reichwein.it>2023-02-04 12:43:51 +0100
commitc4a1f194e79a7834a54fdbf63d73c33e434b4825 (patch)
tree51eae6c701f38e47790b7200b423de8c89b38465 /tests/test-storage.cpp
parent1771f788a5b9e844f0a5315faee104648e3b7d88 (diff)
Added stats.html
Diffstat (limited to 'tests/test-storage.cpp')
-rw-r--r--tests/test-storage.cpp28
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());
}