diff options
author | Marcin Siodelski <marcin@isc.org> | 2019-08-21 17:34:01 +0200 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2019-08-21 17:34:01 +0200 |
commit | 3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4 (patch) | |
tree | da78e54ed286a34d56da50b456ede8e6e9061e93 /src/lib | |
parent | [#847,!23-p] Added ChangeLog for #847. (diff) | |
download | kea-3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4.tar.xz kea-3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4.zip |
[#851,!24-p] Created unit test for MySQL binding holding empty string.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/mysql/tests/mysql_binding_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/mysql/tests/mysql_binding_unittest.cc b/src/lib/mysql/tests/mysql_binding_unittest.cc index 851b002da6..331dfa866a 100644 --- a/src/lib/mysql/tests/mysql_binding_unittest.cc +++ b/src/lib/mysql/tests/mysql_binding_unittest.cc @@ -43,6 +43,13 @@ TEST(MySqlBindingTest, conditionalString) { EXPECT_EQ("foo", binding->getString()); } +// This test verifies that empty string is stored in the database. +TEST(MySqlBindingTest, emptyString) { + auto binding = MySqlBinding::condCreateString(Optional<std::string>("")); + ASSERT_FALSE(binding->amNull()); + EXPECT_TRUE(binding->getString().empty()); +} + // This test verifies that an error is thrown upon an attempt to use // invalid accessor for a string binding. TEST(MySqlBindingTest, stringTypeMismatch) { |