mirror of
https://github.com/rbock/sqlpp11.git
synced 2025-12-31 02:00:24 -06:00
Fixed a bunch of missing initializations
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
|
||||
int insert(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb db{};
|
||||
|
||||
test::TabPerson p;
|
||||
test::TabFeature f;
|
||||
const auto p = test::TabPerson{};
|
||||
const auto f = test::TabFeature{};
|
||||
|
||||
db(insert_into(f).set(f.name = "loves c++", f.fatal = false));
|
||||
|
||||
|
||||
@@ -65,9 +65,9 @@ SQLPP_DECLARE_TABLE(
|
||||
|
||||
int ppgen(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
tab_person::tab_person p;
|
||||
tab_feature::tab_feature f;
|
||||
MockDb db{};
|
||||
const auto p = tab_person::tab_person{};
|
||||
const auto f = tab_feature::tab_feature{};
|
||||
|
||||
db(insert_into(f).set(f.name = "loves c++", f.fatal = false));
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
|
||||
int remove(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb db{};
|
||||
|
||||
test::TabPerson p;
|
||||
test::TabFeature q;
|
||||
const auto p = test::TabPerson{};
|
||||
const auto q = test::TabFeature{};
|
||||
|
||||
db(remove_from(p).using_(p, q).where(p.feature == q.id and q.fatal == true));
|
||||
return 0;
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
MockDb db;
|
||||
MockDb db{};
|
||||
|
||||
test::TabPerson p;
|
||||
test::TabFeature f;
|
||||
const auto p = test::TabPerson{};
|
||||
const auto f = test::TabFeature{};
|
||||
|
||||
db(insert_into(f).set(f.name = "Loves C++", p.fatal = false));
|
||||
|
||||
|
||||
@@ -41,10 +41,12 @@ int select(int, char**)
|
||||
static constexpr bool some_condition = true;
|
||||
static constexpr bool some_other_condition = false;
|
||||
|
||||
MockDb db;
|
||||
MockDb db{};
|
||||
|
||||
test::TabPerson p;
|
||||
test::TabFeature f;
|
||||
const auto p = test::TabPerson{};
|
||||
#if 0
|
||||
const auto f = test::TabFeature{};
|
||||
#endif
|
||||
|
||||
for (const auto& row : db(select(all_of(p)).from(p).where(p.id > 7)))
|
||||
{
|
||||
|
||||
@@ -29,10 +29,9 @@
|
||||
|
||||
int update(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb db{};
|
||||
|
||||
test::TabPerson p;
|
||||
// test::TabFeature q;
|
||||
const auto p = test::TabPerson{};
|
||||
|
||||
db(update(p).set(p.feature = 7).where(p.id == 23));
|
||||
return 0;
|
||||
|
||||
@@ -32,7 +32,7 @@ MockDb db;
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
count(count(t.alpha));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ MockDb db;
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
max(max(t.alpha));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ MockDb db;
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
insert_into(t).set(t.alpha = 7, t.gamma = false, t.beta = "alpha must not be set");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ MockDb db;
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
update(t).set(t.alpha = 7, t.gamma = false, t.beta = "alpha must not be set");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ EnforceDb edb{};
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
static_assert(sqlpp::can_be_null_t<decltype(t.alpha)>::value, "t.alpha can be null");
|
||||
static_assert(not sqlpp::null_is_trivial_value_t<decltype(t.alpha)>::value, "t.alpha does not say null_is_trivial");
|
||||
|
||||
@@ -32,7 +32,7 @@ MockDb db;
|
||||
|
||||
int main()
|
||||
{
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
insert_into(t).set(t.beta = "need also to insert gamma");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
int BooleanExpression(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
auto x = boolean_expression(db, not(t.alpha == 7));
|
||||
x = sqlpp::boolean_expression<MockDb>(t.beta.like("%cheesecake"));
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
int CustomQuery(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
// A void custom query
|
||||
printer.reset();
|
||||
|
||||
@@ -33,8 +33,8 @@ SQLPP_ALIAS_PROVIDER(now)
|
||||
int DateTime(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
test::TabDateTime t;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
const auto t = test::TabDateTime{};
|
||||
|
||||
for (const auto& row : db(select(::sqlpp::value(std::chrono::system_clock::now()).as(now))))
|
||||
{
|
||||
|
||||
@@ -38,8 +38,8 @@ SQLPP_ALIAS_PROVIDER(kaesekuchen)
|
||||
int Function(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
// f.omega + 4 *= "";
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
int Insert(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
test::TabBar t;
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
const auto t = test::TabBar{};
|
||||
// test::TabFoo f;
|
||||
|
||||
{
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
int Interpret(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
select(t.alpha.as(t.beta));
|
||||
|
||||
serialize(insert_into(t).columns(t.beta, t.gamma), printer).str();
|
||||
|
||||
@@ -33,7 +33,7 @@ int Prepared(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
// test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
// empty parameter lists
|
||||
{
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
|
||||
int Remove(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
{
|
||||
using T = decltype(remove_from(t));
|
||||
|
||||
@@ -36,7 +36,7 @@ int Result(int, char**)
|
||||
MockDb db = {};
|
||||
EnforceDb edb{};
|
||||
|
||||
test::TabBar t;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
static_assert(sqlpp::can_be_null_t<decltype(t.alpha)>::value, "t.alpha can be null");
|
||||
static_assert(not sqlpp::null_is_trivial_value_t<decltype(t.alpha)>::value, "t.alpha does not say null_is_trivial");
|
||||
|
||||
@@ -45,10 +45,10 @@ int64_t getColumn(Db&& db, const Column& column)
|
||||
int Select(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
const auto tab_a = f.as(sqlpp::alias::a);
|
||||
|
||||
getColumn(db, t.alpha);
|
||||
|
||||
@@ -43,14 +43,14 @@ namespace alias
|
||||
int SelectType(int, char**)
|
||||
{
|
||||
MockDb db = {};
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
const auto f = test::TabFoo{};
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
// Test a table
|
||||
{
|
||||
using T = decltype(t);
|
||||
using T = typename std::decay<decltype(t)>::type;
|
||||
static_assert(not sqlpp::is_numeric_t<T>::value, "type requirement");
|
||||
static_assert(not sqlpp::is_integral_t<T>::value, "type requirement");
|
||||
static_assert(not sqlpp::is_floating_point_t<T>::value, "type requirement");
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
int Union(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabBar t;
|
||||
test::TabFoo f;
|
||||
const auto t = test::TabBar{};
|
||||
const auto f = test::TabFoo{};
|
||||
|
||||
db(select(t.alpha).from(t).where(true).union_distinct(select(f.epsilon.as(t.alpha)).from(f).where(true)));
|
||||
db(select(t.alpha).from(t).where(true).union_all(select(f.epsilon.as(t.alpha)).from(f).where(true)));
|
||||
|
||||
@@ -32,10 +32,9 @@
|
||||
int Update(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
test::TabBar t;
|
||||
// test::TabFoo f;
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
{
|
||||
using T = decltype(update(t));
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
int With(int, char**)
|
||||
{
|
||||
MockDb db;
|
||||
MockDb::_serializer_context_t printer;
|
||||
MockDb::_serializer_context_t printer = {};
|
||||
|
||||
const auto t = test::TabBar{};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user