Skip to content

Commit

Permalink
Added a regression test for a leak in after
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Jul 2, 2018
1 parent 032c5f9 commit 53e2b52
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions tests/b6b_test_evloop_after.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of b6b.
*
* Copyright 2018 Dima Krasner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <stdlib.h>
#include <assert.h>

#include <b6b.h>

int main()
{
struct b6b_interp interp;

/* regression test: this used to leak the event loop */
assert(b6b_interp_new_argv(&interp, 0, NULL, B6B_OPT_TRACE));
assert(b6b_call_copy(&interp, "{[$evloop] after 1 {}}", 22) == B6B_OK);
b6b_interp_destroy(&interp);

return EXIT_SUCCESS;
}
3 changes: 2 additions & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ stream_tests = [
['un_server', 'quick', 5],
['un_client', 'quick', 5],
['inet_server', 'quick', 5],
['inet_client', 'quick', 5]
['inet_client', 'quick', 5],
['evloop_after', 'quick', 5]
]

binding_tests = []
Expand Down

0 comments on commit 53e2b52

Please sign in to comment.