From 8aa66a6c6c0d8984b7d2668c03bad5a3b29e3a33 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 5 Oct 2025 15:41:23 +0200 Subject: memops wrapper, remove unused includes --- tests/test_helper.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/test_helper.cpp b/tests/test_helper.cpp index b74916a..1dbb2b2 100644 --- a/tests/test_helper.cpp +++ b/tests/test_helper.cpp @@ -1,13 +1,9 @@ -#define _CRT_SECURE_NO_WARNINGS - -#include -#include - -#include "zip.h" -#include "xml.h" -#include "greatest.h" -#include "timer.h" +#include +#include +#include +#include +#include "memops.hpp" #include "strops.hpp" #include "administration.hpp" #include "administration_reader.hpp" @@ -198,7 +194,7 @@ static bool _test_peppol_file(char* id) { struct xml_string* attr_name = xml_node_attribute_name(node, x); size_t b_length = xml_string_length(attr_name); - uint8_t* b_buffer = (uint8_t*)alloca((b_length + 1) * sizeof(uint8_t)); + uint8_t* b_buffer = (uint8_t*)memops::stack_alloc((b_length + 1) * sizeof(uint8_t)); xml_string_copy(attr_name, b_buffer, b_length); b_buffer[b_length] = 0; @@ -206,7 +202,7 @@ static bool _test_peppol_file(char* id) struct xml_string* attr_content = xml_node_attribute_content(node, x); size_t a_length = xml_string_length(attr_content); - uint8_t* a_buffer = (uint8_t*)alloca((a_length + 1) * sizeof(uint8_t)); + uint8_t* a_buffer = (uint8_t*)memops::stack_alloc((a_length + 1) * sizeof(uint8_t)); xml_string_copy(attr_content, a_buffer, a_length); a_buffer[a_length] = 0; -- cgit v1.2.3-70-g09d2