Test casting a JsonValue to a long

This commit is contained in:
Benoit Blanchon
2014-08-01 14:53:05 +02:00
parent 88510705be
commit 23b5237f74
2 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,11 @@ namespace ArduinoJson
return content.asLong;
}
operator long()
{
return content.asLong;
}
size_t printTo(Print& p) const
{
// handmade polymorphism

View File

@ -29,6 +29,10 @@ namespace JsonGeneratorTests
setValueAndCheckCast(42);
}
TEST_METHOD(Long)
{
setValueAndCheckCast(42L);
}
private: