8000 Fixed Visual Studio's warnings · littlestrange/ArduinoJson@80913b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 80913b8

Browse files
committed
Fixed Visual Studio's warnings
1 parent 02960f2 commit 80913b8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

include/ArduinoJson/Internals/JsonBufferAllocated.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class JsonBufferAllocated {
1616
void *operator new(size_t n, JsonBuffer *jsonBuffer) throw() {
1717
return jsonBuffer->alloc(n);
1818
}
19+
20+
void operator delete(void*, JsonBuffer *) throw() {
21+
}
1922
};
2023
}
2124
}

test/DynamicJsonBuffer_Basic_Tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ TEST_F(DynamicJsonBuffer_Basic_Tests, BlockCountChangesWhenFull) {
4646

4747
TEST_F(DynamicJsonBuffer_Basic_Tests, CanAllocLessThanBlockCapacity) {
4848
void* p1 = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY);
49-
ASSERT_TRUE(p1);
49+
ASSERT_FALSE(p1==NULL);
5050
void* p2 = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY);
51-
ASSERT_TRUE(p2);
51+
ASSERT_FALSE(p2==NULL);
5252
}
5353

5454
TEST_F(DynamicJsonBuffer_Basic_Tests, CantAllocMoreThanBlockCapacity) {
5555
void* p = buffer.alloc(DynamicJsonBuffer::BLOCK_CAPACITY + 1);
56-
ASSERT_FALSE(p);
56+
ASSERT_TRUE(p==NULL);
5757
}
5858

5959
TEST_F(DynamicJsonBuffer_Basic_Tests, ReturnDifferentPointer) {

0 commit comments

Comments
 (0)
0