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 -12
View File
@@ -1,5 +1,3 @@
#include "test_save_load.hpp"
#include <cassert>
#include <iostream>
#include <rfl.hpp>
@@ -8,6 +6,8 @@
#include <string>
#include <vector>
#include <gtest/gtest.h>
namespace test_save_load {
using Age = rfl::Validator<unsigned int,
@@ -22,9 +22,7 @@ struct Person {
std::vector<Person> children;
};
void test() {
std::cout << std::source_location::current().function_name() << std::endl;
TEST(msgpack, test_save_load) {
const auto bart = Person{.first_name = "Bart",
.last_name = "Simpson",
.birthday = "1987-04-19",
@@ -59,12 +57,6 @@ void test() {
const auto string1 = rfl::msgpack::write(homer1);
const auto string2 = rfl::msgpack::write(homer2);
if (string1 != string2) {
std::cout << "Test failed. Content was not identical." << std::endl
<< std::endl;
return;
}
std::cout << "OK" << std::endl << std::endl;
EXPECT_EQ(string1, string2);
}
} // namespace test_save_load