Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/plugin/UtilTest.cpp

Issue 29332775: Issue #1234 - Remove 'CString' From 'ToLowerString()' (Closed)
Patch Set: Created Dec. 15, 2015, 9:10 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« src/plugin/PluginUtil.cpp ('K') | « src/plugin/PluginUtil.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 TEST(BeginsWith, ExtraBad) 65 TEST(BeginsWith, ExtraBad)
66 { 66 {
67 ASSERT_FALSE(BeginsWithForTesting(L"foo", L"foobar")); 67 ASSERT_FALSE(BeginsWithForTesting(L"foo", L"foobar"));
68 } 68 }
69 69
70 TEST(BeginsWith, LongerBad) 70 TEST(BeginsWith, LongerBad)
71 { 71 {
72 ASSERT_FALSE(BeginsWithForTesting(L"foo", L"barfoo")); 72 ASSERT_FALSE(BeginsWithForTesting(L"foo", L"barfoo"));
73 } 73 }
74
75 TEST(ToLowerString, Empty)
76 {
77 ASSERT_EQ(std::wstring(), ToLowerString(L""));
sergei 2015/12/16 10:32:45 It's still not clear why we are using ASSERT in a
Eric 2015/12/16 13:53:27 Because I prefer ASSERT. And as I've said before,
78 }
79
80 TEST(ToLowerString, NotEmpty)
81 {
82 ASSERT_EQ(std::wstring(L"foo"), ToLowerString(L"Foo"));
sergei 2015/12/16 10:32:45 Is it necessary to explicitly construct std::wstri
Eric 2015/12/16 13:53:27 I checked. No. They were in there because I've ha
83 }
84
85 TEST(ToLowerString, NullWithExtra)
86 {
87 ASSERT_EQ(std::wstring(L"\0BAR"), ToLowerString(L"\0BAR"));
sergei 2015/12/16 10:32:45 I think this test and below are incorrect. Mainly
Eric 2015/12/16 13:53:27 Yep. Fixed that. I keep forgetting that constructi
88 }
89
90 TEST(ToLowerString, InternalNull)
91 {
92 ASSERT_EQ(std::wstring(L"foo\0BAR"), ToLowerString(L"Foo\0BAR"));
93 }
OLDNEW
« src/plugin/PluginUtil.cpp ('K') | « src/plugin/PluginUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld