mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 21:36:19 +08:00
28 lines
584 B
C++
28 lines
584 B
C++
#include <rfl.hpp>
|
|
#include <rfl/json.hpp>
|
|
#include <string>
|
|
|
|
#include "write_and_read.hpp"
|
|
|
|
// This example had led to a segfault on GCC 12.
|
|
// To make sure this won't happen again, we include
|
|
// it in our tests.
|
|
namespace test_segfault {
|
|
|
|
struct Data {
|
|
std::string prop1;
|
|
std::string prop2;
|
|
std::string prop3;
|
|
std::string prop4;
|
|
std::string prop5;
|
|
std::string prop6;
|
|
};
|
|
|
|
TEST(json, test_segfault) {
|
|
const auto data = Data{};
|
|
write_and_read(
|
|
data,
|
|
R"({"prop1":"","prop2":"","prop3":"","prop4":"","prop5":"","prop6":""})");
|
|
}
|
|
} // namespace test_segfault
|