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

Delta Between Two Patch Sets: test/plugin/DebugTest.cpp

Issue 29332020: Noissue - Add tracing function 'ToHexLiteral()' (Closed)
Left Patch Set: Created Dec. 6, 2015, 6:24 p.m.
Right Patch Set: fix error messages Created Dec. 21, 2015, 12:51 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
« src/plugin/PluginDebug.cpp ('K') | « src/plugin/PluginDebug.cpp ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 11 matching lines...) Expand all
22 #if defined(_WIN64) 22 #if defined(_WIN64)
23 #define expected_length 18 23 #define expected_length 18
24 #define expected_nullptr_literal L"0x0000000000000000" 24 #define expected_nullptr_literal L"0x0000000000000000"
25 #elif defined(_WIN32) 25 #elif defined(_WIN32)
26 #define expected_length 10 26 #define expected_length 10
27 #define expected_nullptr_literal L"0x00000000" 27 #define expected_nullptr_literal L"0x00000000"
28 #endif 28 #endif
29 29
30 TEST(ToHexLiteral, Null) 30 TEST(ToHexLiteral, Null)
31 { 31 {
32 ASSERT_EQ(expected_nullptr_literal, ToHexLiteral(nullptr)); 32 ASSERT_EQ(expected_nullptr_literal, ToHexLiteral(nullptr));
sergei 2015/12/07 11:04:02 As before, what about using EXPECT_* instead of AS
Eric 2015/12/07 13:06:57 There's no difference between these two when there
33 } 33 }
34 34
35 TEST(ToHexLiteral, NotNull) 35 TEST(ToHexLiteral, NotNull)
36 { 36 {
37 std::unique_ptr<int> p(new int); 37 int p = 0;
sergei 2015/12/07 11:04:02 It can be simply int p = 0; without allocating of
Eric 2015/12/07 13:06:57 Done.
38 ASSERT_NE(p, nullptr); 38 ASSERT_NE(&p, nullptr);
39 ASSERT_EQ(expected_length, ToHexLiteral(p.get()).length()); 39 ASSERT_EQ(expected_length, ToHexLiteral(&p).length());
40 } 40 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld