mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-01-06 00:31:11 +01:00
Fix unit tests to match property tree.
This commit is contained in:
parent
698936aee1
commit
7f23f3694b
@ -402,17 +402,17 @@ class YamlCppValue
|
|||||||
|
|
||||||
bool isBool() const
|
bool isBool() const
|
||||||
{
|
{
|
||||||
return m_value.IsScalar();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDouble() const
|
bool isDouble() const
|
||||||
{
|
{
|
||||||
return m_value.IsScalar();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isInteger() const
|
bool isInteger() const
|
||||||
{
|
{
|
||||||
return m_value.IsScalar();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isNull() const
|
bool isNull() const
|
||||||
@ -422,7 +422,7 @@ class YamlCppValue
|
|||||||
|
|
||||||
bool isNumber() const
|
bool isNumber() const
|
||||||
{
|
{
|
||||||
return m_value.IsScalar();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isObject() const
|
bool isObject() const
|
||||||
@ -432,7 +432,7 @@ class YamlCppValue
|
|||||||
|
|
||||||
bool isString() const
|
bool isString() const
|
||||||
{
|
{
|
||||||
return m_value.IsScalar();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -34,7 +34,9 @@ TEST_F(TestYamlCppAdapter, BasicArrayIteration)
|
|||||||
// Ensure that the elements are returned in the order they were inserted
|
// Ensure that the elements are returned in the order they were inserted
|
||||||
unsigned int expectedValue = 0;
|
unsigned int expectedValue = 0;
|
||||||
for (const valijson::adapters::YamlCppAdapter value : adapter.getArray()) {
|
for (const valijson::adapters::YamlCppAdapter value : adapter.getArray()) {
|
||||||
ASSERT_TRUE(value.isNumber());
|
ASSERT_TRUE(value.isString());
|
||||||
|
ASSERT_FALSE(value.isNumber());
|
||||||
|
ASSERT_TRUE(value.maybeDouble());
|
||||||
EXPECT_EQ(double(expectedValue), value.getDouble());
|
EXPECT_EQ(double(expectedValue), value.getDouble());
|
||||||
expectedValue++;
|
expectedValue++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user