Skip to content

Commit

Permalink
Test integer options, calling get_value with wrong type.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jul 11, 2021
1 parent d88ec0d commit 13b94d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libgnucash/app-utils/test/gtest-gnc-option.cpp
Expand Up @@ -46,6 +46,7 @@ TEST(GncOption, test_string_default_value)
GncOption option("foo", "bar", "baz", "Phony Option", std::string{"waldo"});
EXPECT_STREQ("waldo", option.get_default_value<std::string>().c_str());
EXPECT_STREQ("waldo", option.get_value<std::string>().c_str());
EXPECT_EQ(0, option.get_value<int64_t>());
}

TEST(GncOption, test_string_value)
Expand All @@ -58,6 +59,14 @@ TEST(GncOption, test_string_value)
});
}

TEST(GncOption, test_int64_t_value)
{
GncOption option("foo", "bar", "baz", "Phony Option", INT64_C(123456789));
option.set_value(INT64_C(987654321));
EXPECT_TRUE(option.get_default_value<std::string>().empty());
EXPECT_EQ(INT64_C(987654321), option.get_value<int64_t>());
}

TEST(GncOption, test_string_scm_functions)
{
GncOption option("foo", "bar", "baz", "Phony Option", std::string{"waldo"});
Expand Down

0 comments on commit 13b94d2

Please sign in to comment.