mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 05:16:18 +08:00
25 lines
447 B
C++
25 lines
447 B
C++
#include <cassert>
|
|
#include <rfl.hpp>
|
|
|
|
#include "write_and_read.hpp"
|
|
|
|
namespace test_enum {
|
|
|
|
enum class Color { red, green, blue, yellow };
|
|
enum Location { left, centre, right }; // Unscoped enum
|
|
|
|
struct Circle {
|
|
float radius;
|
|
Color color;
|
|
Location location;
|
|
};
|
|
|
|
TEST(generic, test_enum) {
|
|
const auto circle =
|
|
Circle{.radius = 2.0, .color = Color::green, .location = centre};
|
|
|
|
write_and_read(circle);
|
|
}
|
|
|
|
} // namespace test_enum
|