Skip to content

Commit 055dde7

Browse files
committed
test queue boundaries (bug chasing)
1 parent 9243f23 commit 055dde7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

SampleProjects/TestSomething/test/queue.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,20 @@ unittest(copy_constructor)
4848
}
4949
}
5050

51+
unittest(boundaries)
52+
{
53+
ArduinoCIQueue<int> q;
54+
int data[2] = {11, 22};
55+
for (int i = 0; i < 2; ++i) q.push(data[i]);
56+
57+
assertEqual(2, q.size());
58+
q.pop();
59+
assertEqual(1, q.size());
60+
q.pop();
61+
assertEqual(0, q.size());
62+
q.pop();
63+
assertEqual(0, q.size());
64+
65+
}
66+
5167
unittest_main()

0 commit comments

Comments
 (0)