28#include <gmock/gmock.h>
29#include <gtest/gtest-spi.h>
30#include <gtest/gtest.h>
58 version_tags = {
"first-tag",
"second-tag",
"third-tag",
"fourth-tag" };
61 std::ofstream cp(getCptPath());
70 std::ifstream
is(getCptPath());
72 std::string str = std::string(std::istreambuf_iterator<char>(
is),
73 std::istreambuf_iterator<char>());
74 ASSERT_THAT(str, ::testing::StrEq(
"\n[Section1]\ncurTick=1234\n"
75 "version_tags=first-tag fourth-tag second-tag third-tag\n"));
81 version_tags = {
"first-tag-un",
"second-tag-un",
"third-tag-un",
83 simulateSerialization(
"\n[Section1]\ncurTick=1111\nversion_tags="
84 "first-tag-un second-tag-un third-tag-un fourth-tag-un\n");
103 simulateSerialization(
"\n[Section1]\ncurTick=2222\n");
113 ::testing::HasSubstr(
"Checkpoint uses an old versioning scheme."));
120 version_tags = {
"first-tag-un",
"second-tag-un",
"third-tag-un",
122 simulateSerialization(
"\n[Section1]\ncurTick=3333\n"
123 "version_tags=second-tag-un fourth-tag-un\n");
132 "warn: first-tag-un\nwarn: third-tag-un\n"));
139 version_tags = {
"first-tag-un",
"second-tag-un",
"third-tag-un" };
140 simulateSerialization(
"\n[Section1]\ncurTick=4444\nversion_tags="
141 "first-tag-un second-tag-un third-tag-un fourth-tag-un\n");
150 ::testing::HasSubstr(
"warn: fourth-tag-un\n"));
160 simulateSerialization(
"\n[Section1]\n");
void setCurTick(Tick tick)
Assign a value to the current simulation tick.
Container for serializing global variables (not associated with any serialized object).
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Fixture class that handles temporary directory creation.
TEST_F(GlobalsSerializationFixture, Serialization)
Test serialization.
SerializationFixture GlobalsSerializationFixture
GTestTickHandler tickHandler
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::set< std::string > version_tags
The version tags for this build of the simulator, to be stored in the Globals section during serializ...
thread_local GTestLogOutput gtestLogOutput