mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Test runner will also check for leaks.
- `write` of qoi would leak memory. - Issue when having an empty `Path` or just "." - `set_env` would leak memory.
This commit is contained in:
@@ -77,7 +77,7 @@ fn void shared_mutex_decrement(ArgsWrapper1* args)
|
||||
args.m.unlock()!!;
|
||||
}
|
||||
|
||||
fn void shared_mutex() @test
|
||||
fn void shared_mutex() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
Mutex m;
|
||||
m.init()!!;
|
||||
@@ -127,7 +127,7 @@ fn void acquire_recursively(RecursiveMutex* m)
|
||||
}
|
||||
}
|
||||
|
||||
fn void test_recursive_mutex() @test
|
||||
fn void test_recursive_mutex() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
RecursiveMutex m;
|
||||
m.init()!!;
|
||||
|
||||
@@ -5,7 +5,7 @@ import std::thread::pool;
|
||||
|
||||
def Pool = ThreadPool(<4>);
|
||||
|
||||
fn void init_destroy() @test
|
||||
fn void init_destroy() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
for (usz i = 0; i < 20; i++)
|
||||
{
|
||||
@@ -15,7 +15,7 @@ fn void init_destroy() @test
|
||||
}
|
||||
}
|
||||
|
||||
fn void push_destroy() @test
|
||||
fn void push_destroy() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
for FOO: (usz i = 0; i < 20; i++)
|
||||
{
|
||||
@@ -42,7 +42,7 @@ fn void push_destroy() @test
|
||||
}
|
||||
}
|
||||
|
||||
fn void push_stop() @test
|
||||
fn void push_stop() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
for (usz i = 0; i < 20; i++)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ import std::io;
|
||||
|
||||
int a;
|
||||
|
||||
fn void testrun() @test
|
||||
fn void testrun() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
Thread t;
|
||||
a = 0;
|
||||
@@ -18,7 +18,7 @@ fn void testrun() @test
|
||||
|
||||
Mutex m_global;
|
||||
|
||||
fn void testrun_mutex() @test
|
||||
fn void testrun_mutex() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
Thread[20] ts;
|
||||
a = 0;
|
||||
@@ -48,7 +48,7 @@ fn void testrun_mutex() @test
|
||||
m_global.destroy()!!;
|
||||
}
|
||||
|
||||
fn void testrun_mutex_try() @test
|
||||
fn void testrun_mutex_try() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
Mutex m;
|
||||
m.init()!!;
|
||||
@@ -59,7 +59,7 @@ fn void testrun_mutex_try() @test
|
||||
m.unlock()!!;
|
||||
}
|
||||
|
||||
fn void testrun_mutex_timeout() @test
|
||||
fn void testrun_mutex_timeout() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
TimedMutex m;
|
||||
m.init()!!;
|
||||
@@ -80,7 +80,7 @@ fn void call_once()
|
||||
x_once += 100;
|
||||
}
|
||||
|
||||
fn void testrun_once() @test
|
||||
fn void testrun_once() @test => mem::@scoped(&allocator::LIBC_ALLOCATOR)
|
||||
{
|
||||
OnceFlag once;
|
||||
once.call(&call_once);
|
||||
|
||||
Reference in New Issue
Block a user