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

Delta Between Two Patch Sets: test/compiled/String.cpp

Issue 29680720: Issue 6221 - Add native tests. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Jan. 26, 2018, 8:49 p.m.
Right Patch Set: Review comments addressed Created Jan. 29, 2018, 4:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
1 17
2 #include <string> 18 #include <string>
3
sergei 2018/01/26 22:13:36 Could you please remove the empty lines and add th
hub 2018/01/27 03:33:37 Done.
4 #include "gtest/gtest.h" 19 #include "gtest/gtest.h"
5
6 #include "compiled/String.h" 20 #include "compiled/String.h"
7 21
8 TEST(TestString, DependentString) 22 TEST(TestString, constructInvalidDependentString)
9 { 23 {
10 DependentString s; 24 DependentString s;
11 EXPECT_TRUE(s.is_invalid()); 25 EXPECT_TRUE(s.is_invalid());
12 26
13 DependentString s2(s); 27 DependentString s2(s);
14 EXPECT_TRUE(s2.is_invalid()); 28 EXPECT_TRUE(s2.is_invalid());
15 } 29 }
16 30
17 TEST(TestString, OwnedString) 31 TEST(TestString, constructInvalidOwnedString)
18 { 32 {
19 OwnedString s; 33 OwnedString s;
20 EXPECT_TRUE(s.is_invalid()); 34 EXPECT_TRUE(s.is_invalid());
21 35
22 // Valid string 36 // Valid string
23 OwnedString s2(2); 37 OwnedString s2(2);
24 EXPECT_FALSE(s2.is_invalid()); 38 EXPECT_FALSE(s2.is_invalid());
25 39
26 // Ensure we still have an invalid string. 40 // Ensure we still have an invalid string.
27 OwnedString s3(s); 41 OwnedString s3(s);
28 EXPECT_TRUE(s3.is_invalid()); 42 EXPECT_TRUE(s3.is_invalid());
29 43
30 // Empty valid string lead to valid string. 44 // Empty valid string lead to valid string.
31 OwnedString s4(u""_str); 45 OwnedString s4(u""_str);
32 EXPECT_FALSE(s4.is_invalid()); 46 EXPECT_FALSE(s4.is_invalid());
33 } 47 }
34 48
LEFTRIGHT

Powered by Google App Engine
This is Rietveld