Added JsonValue::as<T>()

This commit is contained in:
Benoit Blanchon
2014-10-23 17:22:23 +02:00
parent 8947a6c9de
commit e4779512e6
7 changed files with 24 additions and 18 deletions

View File

@ -44,12 +44,12 @@ protected:
template<typename T>
void elementAtIndexMustBe(int index, T expected)
{
EXPECT_EQ(expected, static_cast<T>(_array[index]));
EXPECT_EQ(expected, _array[index].as<T>());
}
void elementAtIndexMustBe(int index, const char* expected)
{
EXPECT_STREQ(expected, static_cast<const char*>(_array[index]));
EXPECT_STREQ(expected, _array[index].as<const char*>());
}
StaticJsonBuffer<42> _jsonBuffer;