summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
Diffstat (limited to 'AK')
-rw-r--r--AK/Tests/TestCircularQueue.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/AK/Tests/TestCircularQueue.cpp b/AK/Tests/TestCircularQueue.cpp
index 65425aa1fb..53a7803b68 100644
--- a/AK/Tests/TestCircularQueue.cpp
+++ b/AK/Tests/TestCircularQueue.cpp
@@ -75,4 +75,16 @@ TEST_CASE(complex_type_clear)
EXPECT_EQ(strings.size(), 0u);
}
+struct ConstructorCounter {
+ static unsigned s_num_constructor_calls;
+ ConstructorCounter() { ++s_num_constructor_calls; }
+};
+unsigned ConstructorCounter::s_num_constructor_calls = 0;
+
+TEST_CASE(should_not_call_value_type_constructor_when_created)
+{
+ CircularQueue<ConstructorCounter, 10> queue;
+ EXPECT_EQ(0u, ConstructorCounter::s_num_constructor_calls);
+}
+
TEST_MAIN(CircularQueue)