diff --git a/services/tunnelbroker/test/DatabaseManagerTest.cpp b/services/tunnelbroker/test/DatabaseManagerTest.cpp --- a/services/tunnelbroker/test/DatabaseManagerTest.cpp +++ b/services/tunnelbroker/test/DatabaseManagerTest.cpp @@ -38,6 +38,7 @@ "6d37StvXBzfJoZVU79UeOF2bFvb3DNoArEOe", "7s6ZUSDoFfZe3eJWQ15ngYhgMw1TsfbECnMVQTYvY6OyqWPBQi5wiftFcluoxor8", static_cast(std::time(0)) + 600); + const size_t currentTimestamp = static_cast(std::time(0)); EXPECT_EQ( database::DatabaseManager::getInstance().isTableAvailable( item.getTableName()), @@ -52,6 +53,10 @@ EXPECT_EQ(item.getPayload(), foundItem->getPayload()); EXPECT_EQ(item.getBlobHashes(), foundItem->getBlobHashes()); EXPECT_EQ(item.getExpire(), foundItem->getExpire()); + EXPECT_EQ( + foundItem->getCreatedAt() >= currentTimestamp && + foundItem->getCreatedAt() <= static_cast(std::time(0), + true); database::DatabaseManager::getInstance().removeMessageItem( item.getMessageID()); }