aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/kstd/kstd/ring_buffer.tests.cpp20
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())>);
+ }
}
}