Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destress doctest loops for when/then tests #10

Merged
merged 1 commit into from
May 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions tests/dbvalue/dbvaluetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,34 @@ SCENARIO ("using value, basics")
check (dbval).getDefaults ();
}
}
// FIXME yesterday it worked, today it creats a test timeout
// WHEN ("copy a typed value to a variant one")
// {
// DbValue v{Type::Variant};
// THEN ("this always succeed")
// {
// v = dbval;
// CHECK (value_type_eq (v.value (), dbval.value ()));
// }
// }
}
}
GIVEN ("another list of typed types with value")
{
Types types{{Type::Int, Type::Int, Type::Real, Type::Text, Type::Blob}};

std::vector<DbValue> vals{
DbValue{1, types[0]},
DbValue{int64_t{1000}, types[1]},
DbValue{2.1, types[2]},
DbValue{"hi", types[3]},
DbValue{Blob{{std::byte{'a'}, std::byte{'f'}}}, types[4]}};

size_t sizeIdx = 0;

for (DbValue& dbval : vals)
{
CHECK (types[sizeIdx] == dbval.dbtype ());
sizeIdx += 1;
WHEN ("copy a typed value to a variant one")
{
DbValue v{Type::Variant};
THEN ("this always succeed")
{
v = dbval;
CHECK (value_type_eq (v.value (), dbval.value ()));
}
}
}
}
}
Expand Down