File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,16 @@ class NotBeforeTest : public testing::Test {
6262 public:
6363 using queue_t = not_before_queue_t <tv_t , test_time_t >;
6464
65+ ~NotBeforeTest () {
66+ // Advance time until all queued items become eligible for processing.
67+ // This ensures complete dequeuing during test teardown, preventing memory leaks.
68+ // We assume test cutoff timepoints remain within reasonable bounds. If a specified
69+ // timepoint precedes current time, the process continues advancing normally.
70+ for (unsigned when = 1 ; queue.eligible_count () < queue.total_count (); when += 1 ) {
71+ queue.advance_time (when);
72+ }
73+ while (queue.dequeue ()) {}
74+ }
6575 void load_test_data (const std::vector<tv_t > &dt) {
6676 for (const auto &d : dt) {
6777 queue.enqueue (d);
You can’t perform that action at this time.
0 commit comments