ssp/test/test_helpers.hpp

28 lines
489 B
C++
Raw Normal View History

2021-01-23 21:39:18 +01:00
#pragma once
#include <cstring>
#ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h>
#else
#include <doctest.h>
#endif
class buffer {
constexpr static auto buff_size = 1024;
char data_[buff_size];
public:
char* operator()(const char* data) {
memset(data_, '\0', buff_size);
strcpy(data_, data);
return data_;
}
char* append(const char* data) {
strcat(data_, data);
return data_;
}
2021-01-23 21:39:18 +01:00
};
[[maybe_unused]] inline buffer buff;