diff options
author | Paul Stewart <pstew@chromium.org> | 2012-03-26 07:13:51 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-03-26 12:23:44 -0700 |
commit | 88125fbf2ea645ad213dd00860425da6af6a422a (patch) | |
tree | 938961c0828d54d26dad63fb7428ea27631c7454 /key_value_store_unittest.cc | |
parent | 1c1152030c1bab9f91450b508777feac8c162e60 (diff) | |
download | shill-88125fbf2ea645ad213dd00860425da6af6a422a.tar.gz |
shill: key_value_store: Implement "Remove"
BUG=chromium-os:28303
TEST=New unit tests
Change-Id: I62836142eed1fd69ec71039c5556fe8f31d16b59
Reviewed-on: https://gerrit.chromium.org/gerrit/19068
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Diffstat (limited to 'key_value_store_unittest.cc')
-rw-r--r-- | key_value_store_unittest.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/key_value_store_unittest.cc b/key_value_store_unittest.cc index 03964da1..33123d29 100644 --- a/key_value_store_unittest.cc +++ b/key_value_store_unittest.cc @@ -24,4 +24,15 @@ TEST_F(KeyValueStoreTest, LookupString) { EXPECT_EQ("zoo", store_.LookupString("foo", "bar")); } +TEST_F(KeyValueStoreTest, RemoveString) { + const std::string kKey("foo"); + store_.SetString(kKey, "zoo"); + EXPECT_EQ("zoo", store_.LookupString(kKey, "bar")); + store_.RemoveString(kKey); + EXPECT_EQ("bar", store_.LookupString(kKey, "bar")); + // Make sure we don't get an exception/infinite loop if we do a + // "RemoveString()" when the key does not exist. + store_.RemoveString(kKey); +} + } // namespace shill |