Skip to content

Commit

Permalink
feat: bump serialization version to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Jul 31, 2024
1 parent 57d40a4 commit 35b7b62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/silo/common/data_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DataVersion {
uint32_t value;
};

static constexpr SerializationVersion CURRENT_SILO_SERIALIZATION_VERSION{1};
static constexpr SerializationVersion CURRENT_SILO_SERIALIZATION_VERSION{2};

private:
Timestamp timestamp;
Expand Down
8 changes: 4 additions & 4 deletions src/silo_api/database_directory_watcher.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ TEST(DatabaseDirectoryWatcher, validNewFormatOldVersion) {

TEST(DatabaseDirectoryWatcher, validNewFormatCurrentVersion) {
auto under_test =
DatabaseDirectoryWatcher::checkValidDataSource("testBaseData/dataDirectories/1236");
DatabaseDirectoryWatcher::checkValidDataSource("testBaseData/dataDirectories/1237");
ASSERT_TRUE(under_test.has_value());
ASSERT_TRUE(under_test.value().isCompatibleVersion());
ASSERT_EQ(under_test->getTimestamp(), silo::DataVersion::Timestamp::fromString("1236"));
ASSERT_EQ(under_test->getTimestamp(), silo::DataVersion::Timestamp::fromString("1237"));
}

TEST(DatabaseDirectoryWatcher, validNewFormatIncompatible) {
Expand Down Expand Up @@ -69,9 +69,9 @@ TEST(DatabaseDirectoryWatcher, getsMostRecentCompatible) {
auto under_test =
DatabaseDirectoryWatcher::getMostRecentDataDirectory("testBaseData/dataDirectories");
ASSERT_TRUE(under_test.has_value());
ASSERT_EQ(under_test.value().first, "testBaseData/dataDirectories/1236");
ASSERT_EQ(under_test.value().first, "testBaseData/dataDirectories/1237");
ASSERT_TRUE(under_test.value().second.isCompatibleVersion());
ASSERT_EQ(
under_test.value().second.getTimestamp(), silo::DataVersion::Timestamp::fromString("1236")
under_test.value().second.getTimestamp(), silo::DataVersion::Timestamp::fromString("1237")
);
}
2 changes: 2 additions & 0 deletions testBaseData/dataDirectories/1237/data_version.silo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
timestamp: 1237
serializationVersion: 2

0 comments on commit 35b7b62

Please sign in to comment.