diff --git a/.gitignore b/.gitignore index 8274b1f..7768f3c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ node_modules # Xmake .xmake +*.tmp \ No newline at end of file diff --git a/processor/test/cases/pmanager.cpp b/processor/test/cases/pmanager.cpp index d1afebc..ced1929 100644 --- a/processor/test/cases/pmanager.cpp +++ b/processor/test/cases/pmanager.cpp @@ -3,6 +3,7 @@ #include "test/u.hpp" #include #include +#include inline namespace { @@ -36,12 +37,16 @@ AddTestCase _(20, "ProcedureManager", [](TestCase& t) { 0x01, 0x00, 0x00, 0x00, }; - unsigned char obuf[256]; - - FILE *in = fmemopen(ibuf, 256, "r"), - *out = fmemopen(obuf, 256, "w"); + FILE *in = fopen(".in.tmp", "wb"); + fwrite(ibuf, 128, 1, in); + fclose(in); + in = fopen(".in.tmp", "rb"); + FILE *out = fopen(".out.tmp", "wb"); + pm.handleCall(in, out); pm.handleCall(in, out); + fclose(in); + fclose(out); return x; }, 1); }); diff --git a/processor/xmake.lua b/processor/xmake.lua index 855169e..43918c9 100644 --- a/processor/xmake.lua +++ b/processor/xmake.lua @@ -4,7 +4,7 @@ set_version("0.1.0") set_languages("c++20") set_targetdir("build") -add_includedirs(".") +add_includedirs(".", "pc", "utility") add_files("pc/*.cpp", "utility/*.cpp") target("main")