File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,6 +159,24 @@ void test_outbox_removeCurrent() {
159159 // Valgrind should not detect a leak here
160160}
161161
162+ void test_outbox_remove_consecutive () {
163+ Outbox<uint32_t > outbox;
164+
165+ for (uint32_t i = 1 ; i <= 5 ; i++) {
166+ outbox.emplace (i);
167+ }
168+ TEST_ASSERT_EQUAL_UINT32 (5 , outbox.size ());
169+
170+ Outbox<uint32_t >::Iterator it = outbox.front ();
171+ ++it; // 2
172+ ++it; // 3
173+
174+ outbox.remove (it); // removes 3
175+ outbox.remove (it); // removes 4
176+
177+ TEST_ASSERT_EQUAL_UINT32 (3 , outbox.size ());
178+ }
179+
162180int main () {
163181 UNITY_BEGIN ();
164182 RUN_TEST (test_outbox_create);
@@ -167,5 +185,6 @@ int main() {
167185 RUN_TEST (test_outbox_remove1);
168186 RUN_TEST (test_outbox_remove2);
169187 RUN_TEST (test_outbox_removeCurrent);
188+ RUN_TEST (test_outbox_remove_consecutive);
170189 return UNITY_END ();
171190}
You can’t perform that action at this time.
0 commit comments