forked from bblanchon/ArduinoJson
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
24d21467dd | |||
41651136bf | |||
5e5f060fc0 | |||
29ab5fc9c2 | |||
80913b8044 | |||
02960f28e4 | |||
8db338ba14 | |||
dadd8986dc | |||
e2016cf65b |
@ -9,4 +9,4 @@ before_script:
|
||||
script:
|
||||
- make && make test
|
||||
after_success:
|
||||
- coveralls --include include --include src --gcov-options '\-lp'
|
||||
- coveralls --exclude test --exclude third-party --gcov-options '\-lp'
|
23
ArduinoJson.cpp
Normal file
23
ArduinoJson.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
|
||||
#ifdef ARDUINO
|
||||
|
||||
// This file is here to help the Arduino IDE find the other files.
|
||||
|
||||
#include "src/Arduino/Print.cpp"
|
||||
#include "src/Internals/IndentedPrint.cpp"
|
||||
#include "src/Internals/JsonParser.cpp"
|
||||
#include "src/Internals/List.cpp"
|
||||
#include "src/Internals/Prettyfier.cpp"
|
||||
#include "src/Internals/QuotedString.cpp"
|
||||
#include "src/Internals/StringBuilder.cpp"
|
||||
#include "src/JsonArray.cpp"
|
||||
#include "src/JsonBuffer.cpp"
|
||||
#include "src/JsonObject.cpp"
|
||||
#include "src/JsonVariant.cpp"
|
||||
|
||||
#endif
|
13
ArduinoJson.h
Normal file
13
ArduinoJson.h
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
|
||||
#ifdef ARDUINO
|
||||
|
||||
// This file is here to help the Arduino IDE find the other files.
|
||||
|
||||
#include "include/ArduinoJson.h"
|
||||
|
||||
#endif
|
@ -1,6 +1,13 @@
|
||||
Arduino JSON: change log
|
||||
========================
|
||||
|
||||
v4.2
|
||||
----
|
||||
|
||||
* Switched back to old library layout (issues #39, #43 and #45)
|
||||
* Removed global new operator overload (issue #40, #45 and #46)
|
||||
* Added an example with EthernetServer
|
||||
|
||||
v4.1
|
||||
----
|
||||
|
||||
|
74
examples/JsonServer/JsonServer.ino
Normal file
74
examples/JsonServer/JsonServer.ino
Normal file
@ -0,0 +1,74 @@
|
||||
// Sample Arduino Json Web Server
|
||||
// Created by Benoit Blanchon.
|
||||
// Heavily inspired by "Web Server" from David A. Mellis and Tom Igoe
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Ethernet.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
IPAddress ip(192, 168, 0, 177);
|
||||
EthernetServer server(80);
|
||||
|
||||
bool readRequest(EthernetClient& client) {
|
||||
bool currentLineIsBlank = true;
|
||||
while (client.connected()) {
|
||||
if (client.available()) {
|
||||
char c = client.read();
|
||||
if (c == '\n' && currentLineIsBlank) {
|
||||
return true;
|
||||
} else if (c == '\n') {
|
||||
currentLineIsBlank = true;
|
||||
} else if (c != '\r') {
|
||||
currentLineIsBlank = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
JsonObject& prepareResponse(JsonBuffer& jsonBuffer) {
|
||||
JsonObject& root = jsonBuffer.createObject();
|
||||
|
||||
JsonArray& analogValues = root.createNestedArray("analog");
|
||||
for (int pin = 0; pin < 6; pin++) {
|
||||
int value = analogRead(pin);
|
||||
analogValues.add(value);
|
||||
}
|
||||
|
||||
JsonArray& digitalValues = root.createNestedArray("digital");
|
||||
for (int pin = 0; pin < 14; pin++) {
|
||||
int value = digitalRead(pin);
|
||||
digitalValues.add(value);
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
void writeResponse(EthernetClient& client, JsonObject& json) {
|
||||
client.println("HTTP/1.1 200 OK");
|
||||
client.println("Content-Type: application/json");
|
||||
client.println("Connection: close");
|
||||
client.println();
|
||||
|
||||
json.prettyPrintTo(client);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Ethernet.begin(mac, ip);
|
||||
server.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
EthernetClient client = server.available();
|
||||
if (client) {
|
||||
bool success = readRequest(client);
|
||||
if (success) {
|
||||
StaticJsonBuffer<500> jsonBuffer;
|
||||
JsonObject& json = prepareResponse(jsonBuffer);
|
||||
writeResponse(client, json);
|
||||
}
|
||||
delay(1);
|
||||
client.stop();
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
23
include/ArduinoJson/Internals/JsonBufferAllocated.hpp
Normal file
23
include/ArduinoJson/Internals/JsonBufferAllocated.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../JsonBuffer.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
class JsonBufferAllocated {
|
||||
public:
|
||||
void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() {
|
||||
return jsonBuffer->alloc(n);
|
||||
}
|
||||
|
||||
void operator delete(void *, JsonBuffer *) throw() {}
|
||||
};
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -9,7 +9,6 @@
|
||||
#include "../JsonBuffer.hpp"
|
||||
#include "ListConstIterator.hpp"
|
||||
#include "ListIterator.hpp"
|
||||
#include "PlacementNew.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
@ -51,8 +50,7 @@ class List {
|
||||
protected:
|
||||
node_type *createNode() {
|
||||
if (!_buffer) return NULL;
|
||||
void *ptr = _buffer->alloc(sizeof(node_type));
|
||||
return ptr ? new (ptr) node_type() : NULL;
|
||||
return new (_buffer) node_type();
|
||||
}
|
||||
|
||||
void addNode(node_type *nodeToAdd) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -8,16 +8,18 @@
|
||||
|
||||
#include <stddef.h> // for NULL
|
||||
|
||||
#include "JsonBufferAllocated.hpp"
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
// A node for a singly-linked list.
|
||||
// Used by List<T> and its iterators.
|
||||
template <typename T>
|
||||
struct ListNode {
|
||||
struct ListNode : public Internals::JsonBufferAllocated {
|
||||
ListNode() : next(NULL) {}
|
||||
|
||||
ListNode<T>* next;
|
||||
ListNode<T> *next;
|
||||
T content;
|
||||
};
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef ARDUINO
|
||||
|
||||
// Declares the placement new as in <new>.
|
||||
// This is required for Arduino IDE because it doesn't include the <new> header.
|
||||
inline void *operator new(size_t, void *p) throw() { return p; }
|
||||
|
||||
#else
|
||||
|
||||
#include <new>
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Internals/JsonBufferAllocated.hpp"
|
||||
#include "Internals/JsonPrintable.hpp"
|
||||
#include "Internals/List.hpp"
|
||||
#include "Internals/ReferenceType.hpp"
|
||||
@ -30,7 +31,8 @@ class JsonBuffer;
|
||||
// It can also be deserialized from a JSON string via JsonBuffer::parseArray().
|
||||
class JsonArray : public Internals::JsonPrintable<JsonArray>,
|
||||
public Internals::ReferenceType,
|
||||
public Internals::List<JsonVariant> {
|
||||
public Internals::List<JsonVariant>,
|
||||
public Internals::JsonBufferAllocated {
|
||||
// JsonBuffer is a friend because it needs to call the private constructor.
|
||||
friend class JsonBuffer;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -9,6 +9,12 @@
|
||||
#include <stddef.h> // for size_t
|
||||
#include <stdint.h> // for uint8_t
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
|
||||
#endif
|
||||
|
||||
namespace ArduinoJson {
|
||||
class JsonArray;
|
||||
class JsonObject;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -6,6 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Internals/JsonBufferAllocated.hpp"
|
||||
#include "Internals/JsonPrintable.hpp"
|
||||
#include "Internals/List.hpp"
|
||||
#include "Internals/ReferenceType.hpp"
|
||||
@ -30,7 +31,8 @@ class JsonBuffer;
|
||||
// It can also be deserialized from a JSON string via JsonBuffer::parseObject().
|
||||
class JsonObject : public Internals::JsonPrintable<JsonObject>,
|
||||
public Internals::ReferenceType,
|
||||
public Internals::List<JsonPair> {
|
||||
public Internals::List<JsonPair>,
|
||||
public Internals::JsonBufferAllocated {
|
||||
// JsonBuffer is a friend because it needs to call the private constructor.
|
||||
friend class JsonBuffer;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,8 +0,0 @@
|
||||
name=ArduinoJson
|
||||
version=4.0
|
||||
author=Benoit Blanchon <http://blog.benoitblanchon.fr/>
|
||||
maintainer=Benoit Blanchon <http://blog.benoitblanchon.fr/>
|
||||
sentence=An efficient and elegant JSON library for Arduino
|
||||
paragraph=Supports JSON parsing and formatting. Uses fixed memory allocation.
|
||||
url=https://github.com/bblanchon/ArduinoJson
|
||||
architectures=*
|
@ -15,7 +15,9 @@ rm -f $OUTPUT
|
||||
ArduinoJson/examples \
|
||||
ArduinoJson/include \
|
||||
ArduinoJson/keywords.txt \
|
||||
ArduinoJson/library.properties \
|
||||
ArduinoJson/LICENSE.md \
|
||||
ArduinoJson/README.md \
|
||||
ArduinoJson/src
|
||||
ArduinoJson/src \
|
||||
ArduinoJson/ArduinoJson.h \
|
||||
ArduinoJson/ArduinoJson.cpp \
|
||||
-x!ArduinoJson/src/CMakeLists.txt
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,13 +0,0 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
|
||||
// About this file
|
||||
// ---------------
|
||||
// This file is here to please the Arduino IDE. It must be present in the src/
|
||||
// for the IDE to find it. Feel free to ignore this file if your working in
|
||||
// another environment
|
||||
|
||||
#include "../include/ArduinoJson.h"
|
@ -20,6 +20,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||
-Wno-sign-conversion
|
||||
-Wno-unused
|
||||
-Wno-variadic-macros
|
||||
-Wnon-virtual-dtor
|
||||
-Wold-style-cast
|
||||
-Woverloaded-virtual
|
||||
-Wredundant-decls
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
#include "../../include/ArduinoJson/Internals/List.hpp"
|
||||
|
||||
#include "../../include/ArduinoJson/Internals/PlacementNew.hpp"
|
||||
#include "../../include/ArduinoJson/JsonPair.hpp"
|
||||
#include "../../include/ArduinoJson/JsonVariant.hpp"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -8,16 +8,21 @@
|
||||
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
// How to escape special chars:
|
||||
// specialChars[2*i+1] => the special char
|
||||
// specialChars[2*i] => the char to use instead
|
||||
static const char specialChars[] = "\"\"\\\\b\bf\fn\nr\rt\t";
|
||||
|
||||
static inline char getSpecialChar(char c) {
|
||||
// Optimized for code size on a 8-bit AVR
|
||||
|
||||
const char *p = "\"\"\\\\\bb\ff\nn\rr\tt\0";
|
||||
const char *p = specialChars;
|
||||
|
||||
while (p[0] && p[0] != c) {
|
||||
while (p[0] && p[1] != c) {
|
||||
p += 2;
|
||||
}
|
||||
|
||||
return p[1];
|
||||
return p[0];
|
||||
}
|
||||
|
||||
static inline size_t printCharTo(char c, Print &p) {
|
||||
@ -41,7 +46,7 @@ size_t QuotedString::printTo(const char *s, Print &p) {
|
||||
static char unescapeChar(char c) {
|
||||
// Optimized for code size on a 8-bit AVR
|
||||
|
||||
const char *p = "b\bf\fn\nr\rt\t";
|
||||
const char *p = specialChars + 4;
|
||||
|
||||
for (;;) {
|
||||
if (p[0] == '\0') return c;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -7,7 +7,6 @@
|
||||
#include "../include/ArduinoJson/JsonBuffer.hpp"
|
||||
|
||||
#include "../include/ArduinoJson/Internals/JsonParser.hpp"
|
||||
#include "../include/ArduinoJson/Internals/PlacementNew.hpp"
|
||||
#include "../include/ArduinoJson/JsonArray.hpp"
|
||||
#include "../include/ArduinoJson/JsonObject.hpp"
|
||||
|
||||
@ -15,15 +14,13 @@ using namespace ArduinoJson;
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
JsonArray &JsonBuffer::createArray() {
|
||||
void *ptr = alloc(sizeof(JsonArray));
|
||||
if (ptr) return *new (ptr) JsonArray(this);
|
||||
return JsonArray::invalid();
|
||||
JsonArray *ptr = new (this) JsonArray(this);
|
||||
return ptr ? *ptr : JsonArray::invalid();
|
||||
}
|
||||
|
||||
JsonObject &JsonBuffer::createObject() {
|
||||
void *ptr = alloc(sizeof(JsonObject));
|
||||
if (ptr) return *new (ptr) JsonObject(this);
|
||||
return JsonObject::invalid();
|
||||
JsonObject *ptr = new (this) JsonObject(this);
|
||||
return ptr ? *ptr : JsonObject::invalid();
|
||||
}
|
||||
|
||||
JsonArray &JsonBuffer::parseArray(char *json, uint8_t nestingLimit) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
#include <string.h> // for strcmp
|
||||
|
||||
#include "../include/ArduinoJson/Internals/PlacementNew.hpp"
|
||||
#include "../include/ArduinoJson/Internals/StringBuilder.hpp"
|
||||
#include "../include/ArduinoJson/JsonArray.hpp"
|
||||
#include "../include/ArduinoJson/JsonBuffer.hpp"
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
@ -46,14 +46,14 @@ TEST_F(DynamicJsonBuffer_Basic_Tests, BlockCountChangesWhenFull) {
|
||||
|
||||
TEST_F(DynamicJsonBuffer_Basic_Tests, CanAllocLessThanBlockCapacity) {
|
||||
void* p1 = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY);
|
||||
ASSERT_TRUE(p1);
|
||||
ASSERT_FALSE(p1 == NULL);
|
||||
void* p2 = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY);
|
||||
ASSERT_TRUE(p2);
|
||||
ASSERT_FALSE(p2 == NULL);
|
||||
}
|
||||
|
||||
TEST_F(DynamicJsonBuffer_Basic_Tests, CantAllocMoreThanBlockCapacity) {
|
||||
void* p = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY + 1);
|
||||
ASSERT_FALSE(p);
|
||||
ASSERT_TRUE(p == NULL);
|
||||
}
|
||||
|
||||
TEST_F(DynamicJsonBuffer_Basic_Tests, ReturnDifferentPointer) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright Benoit Blanchon 2014
|
||||
// Copyright Benoit Blanchon 2014-2015
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
|
Reference in New Issue
Block a user