Use GTest; resolves #34 (#90)

This commit is contained in:
liuzicheng1987
2024-04-22 23:12:35 +02:00
committed by GitHub
parent bf1c9bea36
commit 325d163196
682 changed files with 1123 additions and 4799 deletions
+4 -16
View File
@@ -1,8 +1,8 @@
#include "test_meta_fields.hpp"
#include <iostream>
#include <rfl.hpp>
#include <gtest/gtest.h>
namespace test_meta_fields {
struct Person {
@@ -13,21 +13,9 @@ struct Person {
std::vector<Person> children;
};
void test() {
std::cout << std::source_location::current().function_name() << std::endl;
TEST(json, test_meta_fields) {
const auto fields = rfl::fields<Person>();
/*std::cout << "Fields in " << rfl::type_name_t<Person>().str() << ":"
<< std::endl;
for (const auto& f : fields) {
std::cout << "name: " << f.name() << ", type: " << f.type() << std::endl;
}*/
// The exact content is somewhat unpredictable, we just want to make sure it
// compiles.
if (fields.size() == 5) {
std::cout << "OK" << std::endl << std::endl;
}
EXPECT_EQ(fields.size(), 5);
}
} // namespace test_meta_fields