Skip to content

Commit

Permalink
Improve testcase for resize_uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Nov 5, 2024
1 parent 7a6b64c commit 44fbf90
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/pq/resize_uninitialized.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ void run()
test( s, 1000000000 );
TEST_ASSERT( s[ 0 ] == 'h' );
TEST_ASSERT( s[ 1 ] == 'e' );

std::vector< std::byte > v = { std::byte( 42 ), std::byte( 69 ) };
TEST_ASSERT( v.size() == 2 );
TEST_ASSERT( v[ 0 ] == std::byte( 42 ) );
TEST_ASSERT( v[ 1 ] == std::byte( 69 ) );

tao::pq::internal::resize_uninitialized( v, 5 );
TEST_ASSERT( v.size() == 5 );
TEST_ASSERT( v[ 0 ] == std::byte( 42 ) );
TEST_ASSERT( v[ 1 ] == std::byte( 69 ) );

tao::pq::internal::resize_uninitialized( v, 1000000000 );
TEST_ASSERT( v.size() == 1000000000 );
TEST_ASSERT( v[ 0 ] == std::byte( 42 ) );
TEST_ASSERT( v[ 1 ] == std::byte( 69 ) );
}

auto main() -> int
Expand Down

0 comments on commit 44fbf90

Please sign in to comment.