fixed linux compile
This commit is contained in:
@@ -38,11 +38,11 @@ TEST_CASE_METHOD( QueryFixture, "Insert and select basic datatypes", "[query][da
|
||||
int8_t cval = 'c';
|
||||
short sval = (std::numeric_limits<short>::min)();
|
||||
int ival = (std::numeric_limits<int>::min)();
|
||||
long long llval = (std::numeric_limits<long long>::max)();
|
||||
int64_t llval = (std::numeric_limits<long long>::max)();
|
||||
unsigned char ucval = (std::numeric_limits<unsigned char>::max)();
|
||||
unsigned short usval = (std::numeric_limits<unsigned short>::max)();
|
||||
unsigned int uival = (std::numeric_limits<unsigned int>::max)();
|
||||
unsigned long long ullval = (std::numeric_limits<unsigned long long>::max)();
|
||||
uint64_t ullval = (std::numeric_limits<unsigned long long>::max)();
|
||||
if (db.type() == "sqlite" || db.type() == "postgres") {
|
||||
ullval = (std::numeric_limits<long long>::max)();
|
||||
}
|
||||
|
||||
@@ -214,13 +214,13 @@ TEST_CASE_METHOD(QueryFixture, "Execute insert record statement", "[query][recor
|
||||
REQUIRE(i.size() == 3);
|
||||
REQUIRE(i.at(0).name() == "id");
|
||||
REQUIRE(i.at(0).is_integer());
|
||||
REQUIRE(i.at(0).template as<long long>() == 7);
|
||||
REQUIRE(i.at(0).template as<uint32_t>() == 7);
|
||||
REQUIRE(i.at(1).name() == "name");
|
||||
REQUIRE(i.at(1).is_varchar());
|
||||
REQUIRE(i.at(1).template as<std::string>() == "george");
|
||||
REQUIRE(i.at(2).name() == "age");
|
||||
REQUIRE(i.at(2).is_integer());
|
||||
REQUIRE(i.at(2).template as<int>() == 45);
|
||||
REQUIRE(i.at(2).template as<uint32_t>() == 45);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,13 +317,13 @@ TEST_CASE_METHOD(QueryFixture, "Execute update record statement", "[query][recor
|
||||
REQUIRE(i.size() == 3);
|
||||
REQUIRE(i.at(0).name() == "id");
|
||||
REQUIRE(i.at(0).is_integer());
|
||||
REQUIRE(i.at(0).as<long long>() == 7);
|
||||
REQUIRE(i.at(0).as<uint32_t>() == 7);
|
||||
REQUIRE(i.at(1).name() == "name");
|
||||
REQUIRE(i.at(1).is_varchar());
|
||||
REQUIRE(i.at(1).as<std::string>() == "jane");
|
||||
REQUIRE(i.at(2).name() == "age");
|
||||
REQUIRE(i.at(2).is_integer());
|
||||
REQUIRE(i.at(2).as<int>() == 35);
|
||||
REQUIRE(i.at(2).as<uint32_t>() == 35);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,13 +75,13 @@ TEST_CASE_METHOD(QueryFixture, "Execute select statement with where clause", "[q
|
||||
REQUIRE(i.size() == 4);
|
||||
REQUIRE(i.at(0).name() == "id");
|
||||
REQUIRE(i.at(0).is_integer());
|
||||
REQUIRE(i.at(0).as<long long>() == george.id);
|
||||
REQUIRE(i.at(0).as<uint32_t>() == george.id);
|
||||
REQUIRE(i.at(1).name() == "name");
|
||||
REQUIRE(i.at(1).is_varchar());
|
||||
REQUIRE(i.at(1).as<std::string>() == george.name);
|
||||
REQUIRE(i.at(2).name() == "age");
|
||||
REQUIRE(i.at(2).is_integer());
|
||||
REQUIRE(i.at(2).as<long long>() == george.age);
|
||||
REQUIRE(i.at(2).as<uint32_t>() == george.age);
|
||||
}
|
||||
|
||||
// fetch person as person
|
||||
@@ -377,10 +377,10 @@ TEST_CASE_METHOD(QueryFixture, "Select statement with foreign key and for single
|
||||
auto f1 = select_result.release();
|
||||
REQUIRE(f1->id == expected_flight->id);
|
||||
REQUIRE(f1->pilot_name == expected_flight->pilot_name);
|
||||
REQUIRE(f1->airplane.get());
|
||||
REQUIRE(f1->airplane->id == 1);
|
||||
REQUIRE(f1->airplane->model == "A380");
|
||||
REQUIRE(f1->airplane->brand == "Airbus");
|
||||
REQUIRE(f1->plane.get());
|
||||
REQUIRE(f1->plane->id == 1);
|
||||
REQUIRE(f1->plane->model == "A380");
|
||||
REQUIRE(f1->plane->brand == "Airbus");
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(QueryFixture, "Select statement with many to many relationship", "[query][join][many_to_many]") {
|
||||
|
||||
@@ -32,10 +32,10 @@ TEST_CASE_METHOD(SessionFixture, "Session relation test", "[session][relation]")
|
||||
auto rf = *res;
|
||||
REQUIRE(rf->id == (*f)->id);
|
||||
REQUIRE(rf->pilot_name == (*f)->pilot_name);
|
||||
REQUIRE(rf->airplane);
|
||||
REQUIRE(rf->airplane->id == (*plane)->id);
|
||||
REQUIRE(rf->airplane->brand == (*plane)->brand);
|
||||
REQUIRE(rf->airplane->model == (*plane)->model);
|
||||
REQUIRE(rf->plane);
|
||||
REQUIRE(rf->plane->id == (*plane)->id);
|
||||
REQUIRE(rf->plane->brand == (*plane)->brand);
|
||||
REQUIRE(rf->plane->model == (*plane)->model);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(SessionFixture, "Use session to find object with id", "[session][find]") {
|
||||
|
||||
Reference in New Issue
Block a user