Skip to content

Commit

Permalink
Test the behavior of AutoConfig if setting an undefined field is atte…
Browse files Browse the repository at this point in the history
…mpted.
  • Loading branch information
Daniel Plemmons committed Jul 6, 2016
1 parent efe3c1d commit 5f997cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/autowiring/test/AutoConfigTest.cpp
Expand Up @@ -84,6 +84,13 @@ TEST_F(AutoConfigTest, ConfigFieldAssign) {
ASSERT_TRUE(x.is_dirty()) << "Config values are assumed to be initially dirty";
}

TEST_F(AutoConfigTest, ConfigFieldSetBad) {
MyConfigurableClass c;

std::string expected{ "There is no config" };
ASSERT_ANY_THROW(autowiring::ConfigSet("z", c, expected.c_str())) << "Tried to set an invalid config key and did not fail.";
}

TEST_F(AutoConfigTest, String) {
MyConfigurableClass c;

Expand Down

0 comments on commit 5f997cf

Please sign in to comment.