summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2019-08-21 17:34:01 +0200
committerMarcin Siodelski <marcin@isc.org>2019-08-21 17:34:01 +0200
commit3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4 (patch)
treeda78e54ed286a34d56da50b456ede8e6e9061e93
parent[#847,!23-p] Added ChangeLog for #847. (diff)
downloadkea-3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4.tar.xz
kea-3e4ee74d5e5eb8753b1298fa1e9ec579a9b250c4.zip
[#851,!24-p] Created unit test for MySQL binding holding empty string.
-rw-r--r--src/lib/mysql/tests/mysql_binding_unittest.cc7
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) {