Skip to content

Commit

Permalink
fix(userspace/libsinsp/test): own events offset in test engine
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
  • Loading branch information
jasondellaluce authored and poiana committed Dec 15, 2022
1 parent d937062 commit 82f2f4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userspace/libsinsp/test/sinsp_with_test_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ class sinsp_with_test_input : public ::testing::Test {
event->ts = ts;
event->tid = tid;

uint64_t evtoffset = m_events.size() - m_test_data->event_count;
m_events.push_back(event);
m_test_data->events = m_events.data();
m_test_data->event_count = m_events.size();
m_test_data->events = m_events.data() + evtoffset;
m_test_data->event_count = m_events.size() - evtoffset;
m_last_recorded_timestamp = ts;

return event;
Expand Down

0 comments on commit 82f2f4c

Please sign in to comment.