Files
reflect-cpp/tests/json/test_underlying_enums.cpp
T
AnsiV01 dfc24ad932 rfl::UnderlyingEnums (#186)
* First part

* Plural

* Update rfl.hpp

* Documentation

* Update rfl.hpp

* Update processors.md

* underlying_enums test

* Update Parser_default.hpp

* Fix typo in test
2024-09-12 09:37:31 +02:00

26 lines
498 B
C++

#include <cassert>
#include <iostream>
#include <rfl.hpp>
#include <rfl/json.hpp>
#include <string>
#include <vector>
#include "write_and_read.hpp"
namespace test_underlying_enums {
enum class Color { red, green, blue, yellow };
struct Circle {
float radius;
Color color;
};
TEST(json, test_underlying_enums) {
const auto circle = Circle{.radius = 2.0, .color = Color::green};
write_and_read<rfl::UnderlyingEnums>(circle, R"({"radius":2.0,"color":1})");
}
} // namespace test_enum1