10000 Test initial value of DynamicJsonBuffer.blockCount() · littlestrange/ArduinoJson@19cce08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19cce08

Browse files
committed
Test initial value of DynamicJsonBuffer.blockCount()
1 parent 3cd6f66 commit 19cce08

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/ArduinoJson/DynamicJsonBuffer.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class DynamicJsonBuffer : public JsonBuffer {
1919

2020
size_t size() const { return _size; }
2121

22+
size_t blockCount() const { return 1; }
23+
2224
static const size_t BLOCK_CAPACITY = 32;
2325

2426
protected:

test/DynamicJsonBuffer_Basic_Tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ TEST_F(DynamicJsonBuffer_Basic_Tests, InitialSizeIsZero) {
2020
ASSERT_EQ(0, buffer.size());
2121
}
2222

23+
TEST_F(DynamicJsonBuffer_Basic_Tests, InitialBlockCountIsOne) {
24+
ASSERT_EQ(1, buffer.blockCount());
25+
}
26+
2327
TEST_F(DynamicJsonBuffer_Basic_Tests, GrowsAfterAlloc) {
2428
buffer.alloc(1);
2529
ASSERT_EQ(1, buffer.size());

0 commit comments

Comments
 (0)
0