Skip to content

Commit

Permalink
Fixed memory leak in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Griezn committed Nov 17, 2024
1 parent f2bde32 commit 586f3d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 63 deletions.
61 changes: 0 additions & 61 deletions benchmark/translator.py

This file was deleted.

13 changes: 11 additions & 2 deletions tests/dataTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,17 @@ TEST(DataTests, test_file_source)
sink_t *gsink = create_generator_sink();
sink_t *fsink = create_generator_sink();

gsink->push_next(gsink, gsource->get_next(gsource));
fsink->push_next(fsink, fsource->get_next(fsource));
data_t *next_gdata = gsource->get_next(gsource);
data_t *next_fdata = fsource->get_next(fsource);

gsink->push_next(gsink, next_gdata);
fsink->push_next(fsink, next_fdata);

ASSERT_TRUE(ARR_EQ(gsink->buffer.data, fsink->buffer.data, gsink->buffer.size));

free(next_gdata);
free(next_fdata);

free_generator_source(gsource);
free_file_source(fsource);
free(gsink); // not the normal because it is still the array allocated int he lib
Expand Down Expand Up @@ -193,6 +199,9 @@ TEST(DataTests, test_file_source_inc)

ASSERT_TRUE(ARR_EQ(gsink->buffer.data + 2*increment, fsink->buffer.data, increment));

free(next_gdata);
free(next_fdata);

free_generator_source(gsource);
free_file_source(fsource);
free(gsink); // not the normal because it is still the array allocated int he lib
Expand Down

0 comments on commit 586f3d1

Please sign in to comment.