Lines Matching refs:TestValue
1308 template<typename T> T TestValue(const char *json, const char *type_name) { in TestValue() function
1340 TEST_EQ(FloatCompare(TestValue<float>("{ Y:0.0314159e+2 }", "float"), in ValueTest()
1344 TEST_EQ(FloatCompare(TestValue<float>("{ Y:\"0.0314159e+2\" }", "float"), in ValueTest()
1349 TEST_EQ(FloatCompare(TestValue<float>("{ Y:cos(rad(180)) }", "float"), -1), in ValueTest()
1353 TEST_EQ(TestValue<int>("{ Y:\"-876\" }", "int=-123"), -876); in ValueTest()
1354 TEST_EQ(TestValue<int>("{ Y:\"876\" }", "int=-123"), 876); in ValueTest()
1357 TEST_EQ(TestValue<int>("{ Y:-0x8ea0 }", "int=-0x8ea0"), -36512); in ValueTest()
1358 TEST_EQ(TestValue<int>(nullptr, "int=-0x8ea0"), -36512); in ValueTest()
1361 TEST_EQ(TestValue<int>("{ Y:0x1abcdef }", "int=0x1"), 0x1abcdef); in ValueTest()
1363 TEST_EQ(TestValue<int>("{ Y:+0x1abcdef }", "int=+0x1"), 0x1abcdef); in ValueTest()
1365 TEST_EQ(TestValue<int>("{ Y:\"0x1abcdef\" }", "int=+0x1"), 0x1abcdef); in ValueTest()
1368 TEST_EQ(TestValue<uint64_t>("{ Y:12335089644688340133 }", "ulong"), in ValueTest()
1372 TEST_EQ(TestValue<bool>("{ Y:\"false\" }", "bool=true"), false); in ValueTest()
1373 TEST_EQ(TestValue<bool>("{ Y:\"true\" }", "bool=\"true\""), true); in ValueTest()
1374 TEST_EQ(TestValue<bool>("{ Y:'false' }", "bool=true"), false); in ValueTest()
1375 TEST_EQ(TestValue<bool>("{ Y:'true' }", "bool=\"true\""), true); in ValueTest()
1378 TEST_EQ(TestValue<int>("/*before*/ { Y:1 } /*after*/", "int"), 1); in ValueTest()
1379 TEST_EQ(TestValue<int>("//before \n { Y:1 } //after", "int"), 1); in ValueTest()
1511 TEST_EQ(TestValue<int8_t>("{ Y:127 }", "byte"), 127); in IntegerBoundaryTest()
1512 TEST_EQ(TestValue<int8_t>("{ Y:-128 }", "byte"), -128); in IntegerBoundaryTest()
1513 TEST_EQ(TestValue<uint8_t>("{ Y:255 }", "ubyte"), 255); in IntegerBoundaryTest()
1514 TEST_EQ(TestValue<uint8_t>("{ Y:0 }", "ubyte"), 0); in IntegerBoundaryTest()
1515 TEST_EQ(TestValue<int16_t>("{ Y:32767 }", "short"), 32767); in IntegerBoundaryTest()
1516 TEST_EQ(TestValue<int16_t>("{ Y:-32768 }", "short"), -32768); in IntegerBoundaryTest()
1517 TEST_EQ(TestValue<uint16_t>("{ Y:65535 }", "ushort"), 65535); in IntegerBoundaryTest()
1518 TEST_EQ(TestValue<uint16_t>("{ Y:0 }", "ushort"), 0); in IntegerBoundaryTest()
1519 TEST_EQ(TestValue<int32_t>("{ Y:2147483647 }", "int"), 2147483647); in IntegerBoundaryTest()
1520 TEST_EQ(TestValue<int32_t>("{ Y:-2147483648 }", "int"), (-2147483647 - 1)); in IntegerBoundaryTest()
1521 TEST_EQ(TestValue<uint32_t>("{ Y:4294967295 }", "uint"), 4294967295); in IntegerBoundaryTest()
1522 TEST_EQ(TestValue<uint32_t>("{ Y:0 }", "uint"), 0); in IntegerBoundaryTest()
1523 TEST_EQ(TestValue<int64_t>("{ Y:9223372036854775807 }", "long"), in IntegerBoundaryTest()
1525 TEST_EQ(TestValue<int64_t>("{ Y:-9223372036854775808 }", "long"), in IntegerBoundaryTest()
1527 TEST_EQ(TestValue<uint64_t>("{ Y:18446744073709551615 }", "ulong"), in IntegerBoundaryTest()
1529 TEST_EQ(TestValue<uint64_t>("{ Y:0 }", "ulong"), 0); in IntegerBoundaryTest()
1530 TEST_EQ(TestValue<uint64_t>("{ Y: 18446744073709551615 }", "uint64"), in IntegerBoundaryTest()
1533 TEST_EQ(TestValue<uint64_t>(nullptr, "uint64 = 18446744073709551615"), in IntegerBoundaryTest()
1541 TEST_EQ(TestValue<float>("{ Y:+3.4029e+38 }", "float"), +infinityf); in ValidFloatTest()
1542 TEST_EQ(TestValue<float>("{ Y:-3.4029e+38 }", "float"), -infinityf); in ValidFloatTest()
1543 TEST_EQ(TestValue<double>("{ Y:+1.7977e+308 }", "double"), +infinityd); in ValidFloatTest()
1544 TEST_EQ(TestValue<double>("{ Y:-1.7977e+308 }", "double"), -infinityd); in ValidFloatTest()
1547 FloatCompare(TestValue<float>("{ Y:0.0314159e+2 }", "float"), 3.14159f), in ValidFloatTest()
1550 TEST_EQ(FloatCompare(TestValue<float>("{ Y:\" 0.0314159e+2 \" }", "float"), in ValidFloatTest()
1554 TEST_EQ(TestValue<float>("{ Y:1 }", "float"), 1.0f); in ValidFloatTest()
1555 TEST_EQ(TestValue<float>("{ Y:1.0 }", "float"), 1.0f); in ValidFloatTest()
1556 TEST_EQ(TestValue<float>("{ Y:1. }", "float"), 1.0f); in ValidFloatTest()
1557 TEST_EQ(TestValue<float>("{ Y:+1. }", "float"), 1.0f); in ValidFloatTest()
1558 TEST_EQ(TestValue<float>("{ Y:-1. }", "float"), -1.0f); in ValidFloatTest()
1559 TEST_EQ(TestValue<float>("{ Y:1.e0 }", "float"), 1.0f); in ValidFloatTest()
1560 TEST_EQ(TestValue<float>("{ Y:1.e+0 }", "float"), 1.0f); in ValidFloatTest()
1561 TEST_EQ(TestValue<float>("{ Y:1.e-0 }", "float"), 1.0f); in ValidFloatTest()
1562 TEST_EQ(TestValue<float>("{ Y:0.125 }", "float"), 0.125f); in ValidFloatTest()
1563 TEST_EQ(TestValue<float>("{ Y:.125 }", "float"), 0.125f); in ValidFloatTest()
1564 TEST_EQ(TestValue<float>("{ Y:-.125 }", "float"), -0.125f); in ValidFloatTest()
1565 TEST_EQ(TestValue<float>("{ Y:+.125 }", "float"), +0.125f); in ValidFloatTest()
1566 TEST_EQ(TestValue<float>("{ Y:5 }", "float"), 5.0f); in ValidFloatTest()
1567 TEST_EQ(TestValue<float>("{ Y:\"5\" }", "float"), 5.0f); in ValidFloatTest()
1572 TEST_EQ(TestValue<double>("{ Y:6.9294956446009195e15 }", "double"), in ValidFloatTest()
1575 TEST_EQ(std::isnan(TestValue<double>("{ Y:nan }", "double")), true); in ValidFloatTest()
1576 TEST_EQ(std::isnan(TestValue<float>("{ Y:nan }", "float")), true); in ValidFloatTest()
1577 TEST_EQ(std::isnan(TestValue<float>("{ Y:\"nan\" }", "float")), true); in ValidFloatTest()
1578 TEST_EQ(std::isnan(TestValue<float>("{ Y:+nan }", "float")), true); in ValidFloatTest()
1579 TEST_EQ(std::isnan(TestValue<float>("{ Y:-nan }", "float")), true); in ValidFloatTest()
1580 TEST_EQ(std::isnan(TestValue<float>(nullptr, "float=nan")), true); in ValidFloatTest()
1581 TEST_EQ(std::isnan(TestValue<float>(nullptr, "float=-nan")), true); in ValidFloatTest()
1583 TEST_EQ(TestValue<float>("{ Y:inf }", "float"), infinityf); in ValidFloatTest()
1584 TEST_EQ(TestValue<float>("{ Y:\"inf\" }", "float"), infinityf); in ValidFloatTest()
1585 TEST_EQ(TestValue<float>("{ Y:+inf }", "float"), infinityf); in ValidFloatTest()
1586 TEST_EQ(TestValue<float>("{ Y:-inf }", "float"), -infinityf); in ValidFloatTest()
1587 TEST_EQ(TestValue<float>(nullptr, "float=inf"), infinityf); in ValidFloatTest()
1588 TEST_EQ(TestValue<float>(nullptr, "float=-inf"), -infinityf); in ValidFloatTest()
1589 TestValue<double>( in ValidFloatTest()
1593 TestValue<float>( in ValidFloatTest()
1601 TEST_EQ(TestValue<double>("{ Y:0x12.34p-1 }", "double"), 9.1015625); in ValidFloatTest()
1603 TEST_EQ(TestValue<float>("{ Y:-0x0.2p0 }", "float"), -0.125f); in ValidFloatTest()
1604 TEST_EQ(TestValue<float>("{ Y:-0x.2p1 }", "float"), -0.25f); in ValidFloatTest()
1605 TEST_EQ(TestValue<float>("{ Y:0x1.2p3 }", "float"), 9.0f); in ValidFloatTest()
1606 TEST_EQ(TestValue<float>("{ Y:0x10.1p0 }", "float"), 16.0625f); in ValidFloatTest()
1607 TEST_EQ(TestValue<double>("{ Y:0x1.2p3 }", "double"), 9.0); in ValidFloatTest()
1608 TEST_EQ(TestValue<double>("{ Y:0x10.1p0 }", "double"), 16.0625); in ValidFloatTest()
1609 TEST_EQ(TestValue<double>("{ Y:0xC.68p+2 }", "double"), 49.625); in ValidFloatTest()
1610 TestValue<double>("{ Y : [0x20.4ep1, +0x20.4ep1, -0x20.4ep1] }", "[double]"); in ValidFloatTest()
1611 TestValue<float>("{ Y : [0x20.4ep1, +0x20.4ep1, -0x20.4ep1] }", "[float]"); in ValidFloatTest()