diff options
| -rw-r--r-- | libs/kstd/kstd/ring_buffer.tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/kstd/kstd/ring_buffer.tests.cpp b/libs/kstd/kstd/ring_buffer.tests.cpp index ae7119ad..d2e4a84d 100644 --- a/libs/kstd/kstd/ring_buffer.tests.cpp +++ b/libs/kstd/kstd/ring_buffer.tests.cpp @@ -141,6 +141,16 @@ SCENARIO("Ring Buffer initialization and construction", "[kstd][ring_buffer]") REQUIRE(buffer.max_size() == buffer.capacity()); } } + + WHEN("constructing by n-copies-of-value constructor using a capacity of 5 and 6 copies") + { + THEN("the constructor panics") + { + REQUIRE_THROWS_MATCHES((kstd::ring_buffer<char, 5>{6, 'a'}), kstd::tests::os_panic, + Catch::Matchers::Message( + "[KSTD] Tried to construct a ring buffer with more elements than it can support.")); + } + } } } |
