Added support for CMake's unity builds

This commit is contained in:
Benoit Blanchon
2019-12-24 16:41:00 +01:00
parent 9723682d20
commit 00c391320c
20 changed files with 226 additions and 223 deletions

View File

@ -8,9 +8,9 @@
using namespace ARDUINOJSON_NAMESPACE;
static char buffer[4096];
TEST_CASE("StringBuilder") {
char buffer[4096];
SECTION("Works when buffer is big enough") {
MemoryPool pool(buffer, addPadding(JSON_STRING_SIZE(6)));

View File

@ -7,9 +7,9 @@
using namespace ARDUINOJSON_NAMESPACE;
static char buffer[4096];
TEST_CASE("MemoryPool::allocVariant()") {
char buffer[4096];
SECTION("Returns different pointer") {
MemoryPool pool(buffer, sizeof(buffer));

View File

@ -7,15 +7,15 @@
using namespace ARDUINOJSON_NAMESPACE;
char buffer[4096];
TEST_CASE("MemoryPool::capacity()") {
char buffer[4096];
const size_t capacity = 64;
MemoryPool pool(buffer, capacity);
REQUIRE(capacity == pool.capacity());
}
TEST_CASE("MemoryPool::size()") {
char buffer[4096];
MemoryPool pool(buffer, sizeof(buffer));
SECTION("Initial size is 0") {