BLOB: Add default-constructed read tests

This commit is contained in:
Robert Adam
2022-09-16 11:49:28 +02:00
parent 52b6862c61
commit 7fa93e8586
3 changed files with 30 additions and 0 deletions

View File

@@ -254,6 +254,16 @@ TEST_CASE("PostgreSQL blob", "[postgresql][blob]")
// in PostgreSQL, BLOB operations must be within transaction block
transaction tr(sql);
{
// Read from default-constructed BLOB
blob b(sql);
CHECK(b.get_len() == 0);
char buf2[5];
std::size_t read = b.read_from_start(buf2, 5);
CHECK(read == 0);
}
{
// empty, default-constructed BLOB
blob b(sql);