mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 19:47:43 +03:00
scratch: don't leave in use after hs_clone_scratch
Also updated unit tests to always check hs_alloc_scratch()'s return value.
This commit is contained in:
committed by
Matthew Barr
parent
6c1143a264
commit
73610c0b64
@@ -83,7 +83,8 @@ void runBlockTest(match_event_handler cb_func) {
|
||||
ASSERT_EQ(1, rc.matches);
|
||||
|
||||
// teardown
|
||||
hs_free_scratch(scratch);
|
||||
err = hs_free_scratch(scratch);
|
||||
ASSERT_EQ(HS_SUCCESS, err);
|
||||
}
|
||||
|
||||
// Generic streaming mode test that uses the given scan callback.
|
||||
@@ -112,7 +113,8 @@ void runStreamingTest(match_event_handler cb_func) {
|
||||
|
||||
// teardown
|
||||
hs_close_stream(stream, scratch, nullptr, nullptr);
|
||||
hs_free_scratch(scratch);
|
||||
err = hs_free_scratch(scratch);
|
||||
ASSERT_EQ(HS_SUCCESS, err);
|
||||
}
|
||||
|
||||
// Generic vectored mode test that uses the given scan callback.
|
||||
@@ -139,7 +141,8 @@ void runVectoredTest(match_event_handler cb_func) {
|
||||
ASSERT_EQ(1, rc.matches);
|
||||
|
||||
// teardown
|
||||
hs_free_scratch(scratch);
|
||||
err = hs_free_scratch(scratch);
|
||||
ASSERT_EQ(HS_SUCCESS, err);
|
||||
}
|
||||
|
||||
static
|
||||
|
Reference in New Issue
Block a user