Cleaning up static asserts for .where(true)

This commit is contained in:
rbock
2016-02-27 19:31:02 +01:00
parent 425e75219c
commit d7a29fac97
2 changed files with 22 additions and 30 deletions

View File

@@ -84,17 +84,17 @@ namespace
where_static_check<sqlpp::assert_where_static_count_args_t>();
// Try assignment as condition
where_static_check<sqlpp::assert_where_expressions_t>(t.gamma = true);
where_static_check<sqlpp::assert_where_boolean_expression_t>(t.gamma = true);
// Try non-boolean expression
where_static_check<sqlpp::assert_where_boolean_t>(t.alpha);
where_static_check<sqlpp::assert_where_boolean_expression_t>(t.alpha);
// Try some other types as expressions
where_static_check<sqlpp::assert_where_expressions_t>("true");
where_static_check<sqlpp::assert_where_expressions_t>(17);
where_static_check<sqlpp::assert_where_expressions_t>('c');
where_static_check<sqlpp::assert_where_expressions_t>(nullptr);
where_static_check<sqlpp::assert_where_expressions_t>(t.alpha.as(t.beta));
where_static_check<sqlpp::assert_where_boolean_expression_t>("true");
where_static_check<sqlpp::assert_where_boolean_expression_t>(17);
where_static_check<sqlpp::assert_where_boolean_expression_t>('c');
where_static_check<sqlpp::assert_where_boolean_expression_t>(nullptr);
where_static_check<sqlpp::assert_where_boolean_expression_t>(t.alpha.as(t.beta));
// Try using aggregate functions in where
where_static_check<sqlpp::assert_where_no_aggregate_functions_t>(count(t.alpha) > 0);
@@ -111,17 +111,17 @@ namespace
where_dynamic_check<sqlpp::consistent_t>(t.gamma == true);
// Try assignment as condition
where_dynamic_check<sqlpp::assert_where_expressions_t>(t.gamma = true);
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>(t.gamma = true);
// Try non-boolean expression
where_dynamic_check<sqlpp::assert_where_boolean_t>(t.alpha);
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>(t.alpha);
// Try some other types as expressions
where_dynamic_check<sqlpp::assert_where_expressions_t>("true");
where_dynamic_check<sqlpp::assert_where_expressions_t>(17);
where_dynamic_check<sqlpp::assert_where_expressions_t>('c');
where_dynamic_check<sqlpp::assert_where_expressions_t>(nullptr);
where_dynamic_check<sqlpp::assert_where_expressions_t>(t.alpha.as(t.beta));
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>("true");
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>(17);
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>('c');
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>(nullptr);
where_dynamic_check<sqlpp::assert_where_boolean_expression_t>(t.alpha.as(t.beta));
// Try using aggregate functions in where
where_dynamic_check<sqlpp::assert_where_no_aggregate_functions_t>(count(t.alpha) > 0);