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
+5 -10
View File
@@ -1,8 +1,5 @@
#include "test_forward_list.hpp"
#include <iostream>
#include <rfl.hpp>
#include <rfl/flexbuf.hpp>
#include <source_location>
#include <string>
#include <vector>
@@ -12,15 +9,12 @@
namespace test_forward_list {
struct Person {
rfl::Field<"firstName", std::string> first_name;
rfl::Field<"lastName", std::string> last_name = "Simpson";
rfl::Field<"children", std::unique_ptr<std::forward_list<Person>>> children =
rfl::default_value;
rfl::Rename<"firstName", std::string> first_name;
rfl::Rename<"lastName", std::string> last_name = "Simpson";
std::unique_ptr<std::forward_list<Person>> children;
};
void test() {
std::cout << std::source_location::current().function_name() << std::endl;
TEST(flexbuf, test_forward_list) {
auto children = std::make_unique<std::forward_list<Person>>();
children->emplace_front(Person{.first_name = "Maggie"});
children->emplace_front(Person{.first_name = "Lisa"});
@@ -30,5 +24,6 @@ void test() {
Person{.first_name = "Homer", .children = std::move(children)};
write_and_read(homer);
}
} // namespace test_forward_list