mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-03 16:56:17 +08:00
@@ -1,3 +1,5 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <rfl.hpp>
|
||||
@@ -5,8 +7,6 @@
|
||||
|
||||
#include "rfl/internal/num_fields.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace test_inheritance2 {
|
||||
|
||||
struct EmptyBase1 {};
|
||||
@@ -30,6 +30,7 @@ struct EmptyDerived1 : EmptyBase1, BaseX {};
|
||||
struct EmptyDerived2 : EmptyBase1, EmptyBase2, BaseX {};
|
||||
|
||||
TEST(json, test_inheritance2) {
|
||||
#ifdef REFLECT_CPP_C_ARRAYS_OR_INHERITANCE
|
||||
Derived1 derived1;
|
||||
const auto derived1_view = rfl::to_view(derived1);
|
||||
static_assert(derived1_view.size() == 2);
|
||||
@@ -51,6 +52,7 @@ TEST(json, test_inheritance2) {
|
||||
static_assert(empty_derived0_view.size() == 2);
|
||||
|
||||
EXPECT_TRUE(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace test_inheritance2
|
||||
|
||||
Reference in New Issue
Block a user