Intensive refactor of DRAMSys project structure and CMakeFiles

This commit is contained in:
Thomas Psota
2022-12-08 15:05:23 +01:00
parent 2d8a5f66e4
commit b63c9beb50
709 changed files with 26751 additions and 1240 deletions

View File

@@ -0,0 +1,38 @@
#include <gtest/gtest.h>
#include <DRAMSys/util/json.h>
class JsonTest : public ::testing::Test {
protected:
virtual void SetUp()
{
}
virtual void TearDown()
{
}
};
TEST_F(JsonTest, Test)
{
auto in = json_t::parse(R"(
{
"test": 5,
"null": null
}
)");
std::optional<int> opt_in;
std::optional<int> opt_null;
std::optional<int> opt_nil;
in["test"].get_to(opt_in);
in["null"].get_to(opt_null);
in["nil"].get_to(opt_nil);
ASSERT_TRUE(opt_in.has_value());
ASSERT_EQ(*opt_in, 5);
ASSERT_FALSE(opt_null.has_value());
ASSERT_FALSE(opt_nil.has_value());
};