From 1a8585211efd34aff431a72f712e8cac7e8f4d3b Mon Sep 17 00:00:00 2001 From: Sven Scharmentke <24257042+svnscha@users.noreply.github.com> Date: Wed, 26 Mar 2025 00:44:59 +0100 Subject: [PATCH] Demo with a tested change. --- src/MyQueue.cpp | 6 ++++++ src/MyQueue.h | 1 + tests/TestMyQueue.cpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/MyQueue.cpp b/src/MyQueue.cpp index ad118e1..deae86e 100644 --- a/src/MyQueue.cpp +++ b/src/MyQueue.cpp @@ -17,3 +17,9 @@ bool MyQueue::IsEmpty() const { return _q.empty(); } + +void MyQueue::NewFunction() +{ + static int nonsense = 0; + nonsense += 1; +} diff --git a/src/MyQueue.h b/src/MyQueue.h index 847a6a8..99f066d 100644 --- a/src/MyQueue.h +++ b/src/MyQueue.h @@ -7,6 +7,7 @@ class MyQueue void Push(int val); void Pop(); bool IsEmpty() const; + void NewFunction(); private: std::queue _q; diff --git a/tests/TestMyQueue.cpp b/tests/TestMyQueue.cpp index 3549507..6c6fbbc 100644 --- a/tests/TestMyQueue.cpp +++ b/tests/TestMyQueue.cpp @@ -14,3 +14,8 @@ TEST(MyQueueTest, PushAndPopWorks) { q.Pop(); EXPECT_TRUE(q.IsEmpty()); } + +TEST(MyQueueTest, TestNonsense) { + MyQueue q; + q.NewFunction(); +}