| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 template<template <typename T> class S> | 24 template<template <typename T> class S> |
| 25 void testStringMap() | 25 void testStringMap() |
| 26 { | 26 { |
| 27 S<std::string> map; | 27 S<std::string> map; |
| 28 | 28 |
| 29 EXPECT_EQ(map.begin(), map.end()); | 29 EXPECT_EQ(map.begin(), map.end()); |
| 30 | 30 |
| 31 auto key = u"Foobar"_str; | 31 auto key = u"Foobar"_str; |
| 32 EXPECT_EQ(key.length(), 6); | 32 EXPECT_EQ(key.length(), 6); |
| 33 EXPECT_EQ(map.size(), 0); | 33 EXPECT_EQ(map.size(), 0); |
| 34 EXPECT_EQ(map.begin(), map.end()); | |
|
sergei
2018/02/12 08:50:05
It seems this line is redundant because `map` is n
hub
2018/02/12 14:20:25
Done.
| |
| 35 | 34 |
| 36 map[u"Foobar"_str] = "one"; | 35 map[u"Foobar"_str] = "one"; |
| 37 EXPECT_EQ(map.size(), 1); | 36 EXPECT_EQ(map.size(), 1); |
| 38 EXPECT_NE(map.begin(), map.end()); | 37 EXPECT_NE(map.begin(), map.end()); |
|
sergei
2018/02/12 08:50:05
That's all right. In addition it would be good to
sergei
2018/02/12 08:54:28
I missed the comment in the issue description, see
| |
| 39 | 38 |
| 40 map[u""_str] = "null"; | 39 map[u""_str] = "null"; |
| 41 EXPECT_EQ(map.size(), 2); | 40 EXPECT_EQ(map.size(), 2); |
| 42 | 41 |
| 43 auto entry = map.find(u"Foobar"_str); | 42 auto entry = map.find(u"Foobar"_str); |
| 44 EXPECT_TRUE(entry); | 43 EXPECT_TRUE(entry); |
| 45 | 44 |
| 46 entry = map.find(u"Foobar2"_str); | 45 entry = map.find(u"Foobar2"_str); |
| 47 EXPECT_FALSE(entry); | 46 EXPECT_FALSE(entry); |
| 48 | 47 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 | 79 |
| 81 TEST(TestStringMap, stringMap) | 80 TEST(TestStringMap, stringMap) |
| 82 { | 81 { |
| 83 testStringMap<StringMap>(); | 82 testStringMap<StringMap>(); |
| 84 } | 83 } |
| 85 | 84 |
| 86 TEST(TestStringMap, ownedStringMap) | 85 TEST(TestStringMap, ownedStringMap) |
| 87 { | 86 { |
| 88 testStringMap<OwnedStringMap>(); | 87 testStringMap<OwnedStringMap>(); |
| 89 } | 88 } |
| LEFT | RIGHT |