fixed postgres tests

This commit is contained in:
2025-02-15 12:36:21 +01:00
parent 6e64ba99de
commit ec96c15905
16 changed files with 89 additions and 58 deletions
+4 -4
View File
@@ -291,8 +291,8 @@ TEST_CASE_METHOD(QueryFixture, "Test describe table", "[query][describe][table]"
std::vector<std::string> column_names = { "id",
"val_char", "val_float", "val_double", "val_short",
"val_int", "val_long", "val_long_long", "val_unsigned_char",
"val_unsigned_short", "val_unsigned_int", "val_unsigned_long", "val_unsigned_long_long",
"val_int", "val_long_long", "val_unsigned_char",
"val_unsigned_short", "val_unsigned_int", "val_unsigned_long_long",
"val_bool", "val_cstr", "val_string", "val_varchar",
// "val_date", "val_time",
"val_binary"};
@@ -307,8 +307,8 @@ TEST_CASE_METHOD(QueryFixture, "Test describe table", "[query][describe][table]"
[](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_integer(); },
// [](const attribute_definition &cf) { return cf.is_integer(); },
// [](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_integer(); },
[](const attribute_definition &cf) { return cf.is_bool(); },
[](const attribute_definition &cf) { return cf.is_varchar(); },
+4 -4
View File
@@ -48,11 +48,11 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find object with id", "[session
auto a380 = ses.insert<airplane>(1, "Boeing", "A380");
REQUIRE(a380.is_ok());
auto res = ses.find<airplane>(2);
REQUIRE(!result.is_ok());
REQUIRE((result.err().ec() == orm::error_code::FailedToFindObject));
auto find_result = ses.find<airplane>(2);
REQUIRE(!find_result.is_ok());
REQUIRE((find_result.err().ec() == orm::error_code::FailedToFindObject));
auto find_result = ses.find<airplane>(1);
find_result = ses.find<airplane>(1);
REQUIRE(find_result);
auto read_a380 = find_result.value();
+1 -1
View File
@@ -30,7 +30,7 @@ struct author {
field::attribute(op, "date_of_birth", date_of_birth, 31);
field::attribute(op, "year_of_birth", year_of_birth);
field::attribute(op, "distinguished", distinguished);
field::has_many(op, "books", books, "author_id", utils::fetch_type::EAGER);
field::has_many(op, "books", books, "author_id", utils::fetch_type::LAZY);
}
};
+1 -1
View File
@@ -13,7 +13,7 @@ struct person {
unsigned int id{};
std::string name;
unsigned int age{};
utils::blob image;
utils::blob image{};
template<class Operator>
void process(Operator &op) {
+2 -2
View File
@@ -16,7 +16,7 @@ struct ingredient
{
unsigned int id{};
std::string name;
std::vector<object::object_ptr<recipe>> recipes;
std::vector<object::object_ptr<recipe>> recipes{};
template<class Operator>
void process(Operator &op) {
@@ -31,7 +31,7 @@ struct recipe
{
unsigned int id{};
std::string name;
std::vector<object::object_ptr<ingredient>> ingredients;
std::vector<object::object_ptr<ingredient>> ingredients{};
template<class Operator>
void process(Operator &op) {