Fix unit tests to match property tree.

This commit is contained in:
Pras Velagapudi 2022-02-11 19:22:14 -05:00
parent 698936aee1
commit 7f23f3694b
2 changed files with 8 additions and 6 deletions

View File

@ -402,17 +402,17 @@ class YamlCppValue
bool isBool() const
{
return m_value.IsScalar();
return false;
}
bool isDouble() const
{
return m_value.IsScalar();
return false;
}
bool isInteger() const
{
return m_value.IsScalar();
return false;
}
bool isNull() const
@ -422,7 +422,7 @@ class YamlCppValue
bool isNumber() const
{
return m_value.IsScalar();
return false;
}
bool isObject() const
@ -432,7 +432,7 @@ class YamlCppValue
bool isString() const
{
return m_value.IsScalar();
return true;
}
private:

View File

@ -34,7 +34,9 @@ TEST_F(TestYamlCppAdapter, BasicArrayIteration)
// Ensure that the elements are returned in the order they were inserted
unsigned int expectedValue = 0;
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());
expectedValue++;
}