From 35b7b623c0481c3067c70ee9f361b0090f5ca595 Mon Sep 17 00:00:00 2001 From: Alexander Taepper Date: Mon, 29 Jul 2024 16:20:43 +0200 Subject: [PATCH] feat: bump serialization version to 2 --- include/silo/common/data_version.h | 2 +- src/silo_api/database_directory_watcher.test.cpp | 8 ++++---- testBaseData/dataDirectories/1237/data_version.silo | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 testBaseData/dataDirectories/1237/data_version.silo diff --git a/include/silo/common/data_version.h b/include/silo/common/data_version.h index d53300226..bcfce5a96 100644 --- a/include/silo/common/data_version.h +++ b/include/silo/common/data_version.h @@ -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; diff --git a/src/silo_api/database_directory_watcher.test.cpp b/src/silo_api/database_directory_watcher.test.cpp index 30375d349..63d47cf22 100644 --- a/src/silo_api/database_directory_watcher.test.cpp +++ b/src/silo_api/database_directory_watcher.test.cpp @@ -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) { @@ -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") ); } diff --git a/testBaseData/dataDirectories/1237/data_version.silo b/testBaseData/dataDirectories/1237/data_version.silo new file mode 100644 index 000000000..2b6916a07 --- /dev/null +++ b/testBaseData/dataDirectories/1237/data_version.silo @@ -0,0 +1,2 @@ +timestamp: 1237 +serializationVersion: 2 \ No newline at end of file