Add arena test
This commit is contained in:
@@ -13,6 +13,12 @@ set RELEASE_LINE=%RELEASE% %WRN% %COMMON% -link -incremental:no %LINK_RELEASE%
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cl.exe -Fe:test_arena.exe ../test/test_arena.cpp %DEBUG_LINE%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
test_arena.exe
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
cl.exe -Fe:cpp_debug.exe ../test/main.cpp %DEBUG_LINE%
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
cl.exe -Fe:cpp_release.exe ../test/main.cpp %RELEASE_LINE%
|
||||
|
||||
1
io.c
1
io.c
@@ -1,4 +1,5 @@
|
||||
#include "io.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef IO_SNPRINTF
|
||||
#include <stdio.h>
|
||||
|
||||
14
test/test_arena.cpp
Normal file
14
test/test_arena.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../io.c"
|
||||
|
||||
#define MA_ASSERT(x) IO_Assert(x)
|
||||
#include "../arena.c"
|
||||
|
||||
int main() {
|
||||
MA_Scratch scratch;
|
||||
int *thing = MA_PushStruct(scratch, int);
|
||||
*thing = 10;
|
||||
|
||||
MA_Arena *arena = MA_Bootstrap();
|
||||
float *thingf = MA_PushStruct(arena, float);
|
||||
*thingf = 10.0f;
|
||||
}
|
||||
Reference in New Issue
Block a user