Skip to content

Commit 5ccec0f

Browse files
committed
Added tests for size_buffer functions [skip ci]
1 parent 61c8878 commit 5ccec0f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

test/pqxx_test.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,18 @@ void test_sparsevec_into_buf() {
340340
});
341341
}
342342

343+
void test_vector_size_buffer() {
344+
assert_equal(pqxx::size_buffer(pgvector::Vector{{1, 2, 3}}), 55u);
345+
}
346+
347+
void test_halfvec_size_buffer() {
348+
assert_equal(pqxx::size_buffer(pgvector::HalfVector{{1, 2, 3}}), 55u);
349+
}
350+
351+
void test_sparsevec_size_buffer() {
352+
assert_equal(pqxx::size_buffer(pgvector::SparseVector{{1, 2, 3}}), 106u);
353+
}
354+
343355
void test_pqxx() {
344356
pqxx::connection conn{"dbname=pgvector_cpp_test"};
345357
setup(conn);
@@ -366,4 +378,8 @@ void test_pqxx() {
366378
test_halfvec_into_buf();
367379
test_sparsevec_to_buf();
368380
test_sparsevec_into_buf();
381+
382+
test_vector_size_buffer();
383+
test_halfvec_size_buffer();
384+
test_sparsevec_size_buffer();
369385
}

0 commit comments

Comments
 (0)