diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-05 15:41:23 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-05 15:41:23 +0200 |
| commit | 8aa66a6c6c0d8984b7d2668c03bad5a3b29e3a33 (patch) | |
| tree | d7d985151b5bcd6687aead3547bdfbdb0600a8c6 /tests | |
| parent | b278d242d03ba614779243ec9e9495fc95abea3d (diff) | |
memops wrapper, remove unused includes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_helper.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
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 <stdlib.h> -#include <malloc.h> - -#include "zip.h" -#include "xml.h" -#include "greatest.h" -#include "timer.h" +#include <zip.h> +#include <xml.h> +#include <greatest.h> +#include <timer.h> +#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; |
