forked from bblanchon/ArduinoJson
Test casting a JsonValue to a long
This commit is contained in:
@ -69,6 +69,11 @@ namespace ArduinoJson
|
|||||||
return content.asLong;
|
return content.asLong;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator long()
|
||||||
|
{
|
||||||
|
return content.asLong;
|
||||||
|
}
|
||||||
|
|
||||||
size_t printTo(Print& p) const
|
size_t printTo(Print& p) const
|
||||||
{
|
{
|
||||||
// handmade polymorphism
|
// handmade polymorphism
|
||||||
|
@ -29,6 +29,10 @@ namespace JsonGeneratorTests
|
|||||||
setValueAndCheckCast(42);
|
setValueAndCheckCast(42);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_METHOD(Long)
|
||||||
|
{
|
||||||
|
setValueAndCheckCast(42L);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user