diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-10-02 15:21:05 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-10-02 15:21:05 +0200 |
| commit | d7d4e918e7a2ef893dff836554893dab6c833cc5 (patch) | |
| tree | af67dd86228ed912fe6a3524ea799eebb9fd1bbc | |
| parent | 5c7c3f83f2d78cbab383cd7e0d4a9a542696cd6d (diff) | |
| download | kernel-d7d4e918e7a2ef893dff836554893dab6c833cc5.tar.xz kernel-d7d4e918e7a2ef893dff836554893dab6c833cc5.zip | |
kstd: ring_buffer: add missing push/pop API tests
| -rw-r--r-- | libs/kstd/kstd/ring_buffer.tests.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/kstd/kstd/ring_buffer.tests.cpp b/libs/kstd/kstd/ring_buffer.tests.cpp index 58037e1c..bd14223f 100644 --- a/libs/kstd/kstd/ring_buffer.tests.cpp +++ b/libs/kstd/kstd/ring_buffer.tests.cpp @@ -172,6 +172,26 @@ SCENARIO("Ring Buffer interface types", "[kstd][ring_buffer]") { STATIC_REQUIRE(std::is_same_v<buffer::const_reverse_iterator, decltype(std::declval<buffer &>().crend())>); } + + THEN("the return type of push_back() is void") + { + STATIC_REQUIRE(std::is_same_v<void, decltype(std::declval<buffer &>().push_back(std::declval<int>()))>); + } + + THEN("the return type of try_push_back() is bool") + { + STATIC_REQUIRE(std::is_same_v<bool, decltype(std::declval<buffer &>().try_push_back(buffer::value_type{}))>); + } + + THEN("the return type of pop_front() is void") + { + STATIC_REQUIRE(std::is_same_v<void, decltype(std::declval<buffer &>().pop_front())>); + } + + THEN("the return type of try_pop_front() is bool") + { + STATIC_REQUIRE(std::is_same_v<bool, decltype(std::declval<buffer &>().try_pop_front())>); + } } } |
