Commit ffc2fb9d authored by msobczak's avatar msobczak

Added tests for vector<long long>

parent 6493a12e
......@@ -190,7 +190,6 @@ struct blob_table_creator : public table_creator_base
}
};
// long long test
void test3()
{
{
......@@ -243,6 +242,7 @@ struct longlong_table_creator : table_creator_base
}
};
// long long test
void test4()
{
{
......@@ -261,6 +261,32 @@ void test4()
assert(v2 == v1);
}
// vector<long long>
{
session sql(backEnd, connectString);
longlong_table_creator tableCreator(sql);
std::vector<long long> v1;
v1.push_back(1000000000000LL);
v1.push_back(1000000000001LL);
v1.push_back(1000000000002LL);
v1.push_back(1000000000003LL);
v1.push_back(1000000000004LL);
sql << "insert into soci_test(val) values(:val)", use(v1);
std::vector<long long> v2(10);
sql << "select val from soci_test order by val desc", into(v2);
assert(v2.size() == 5);
assert(v2[0] == 1000000000004LL);
assert(v2[1] == 1000000000003LL);
assert(v2[2] == 1000000000002LL);
assert(v2[3] == 1000000000001LL);
assert(v2[4] == 1000000000000LL);
}
std::cout << "test 4 passed" << std::endl;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment