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

Delta Between Two Patch Sets: common/test/IeVersionTest.cpp

Issue 6216090891845632: Issue #404 - Create common library shared between plugin/engine and installer (Closed)
Left Patch Set: Rename to IeVersion*.*; fix URL in copyright notice Created Feb. 27, 2015, 1:50 p.m.
Right Patch Set: final check after rebase Created May 19, 2015, 3:36 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
« no previous file with change/comment | « common/src/Registry.cpp ('k') | common/test/RegistryTest.cpp » ('j') | 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 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/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #include <gtest/gtest.h> 18 #include <gtest/gtest.h>
19 #include "IE_Version.h" 19 #include "IE_Version.h"
20 20
21 /* 21 /*
22 * Exact version tests enabled by default. 22 * Exact version tests enabled by default.
23 * If they are disabled, gtext will report 2 disabled tests. 23 * If they are disabled, gtest will report 2 disabled tests.
sergei 2015/03/04 15:53:56 Just to note, gtest, not gtext.
Eric 2015/03/04 16:55:10 Done.
24 */ 24 */
25 #if !defined(DISABLE_EXACT_TESTS) 25 #if !defined(DISABLE_EXACT_TESTS)
Oleksandr 2015/03/04 15:37:23 How about just using if !defined(INSTALLED_IE_VERS
Eric 2015/03/04 16:55:10 If we change it, we can change it elsewhere and la
Felix Dahlke 2015/03/05 13:33:06 The code is being introduced here - if we want to
Eric 2015/03/05 14:49:48 It is not being introduced here. It's being moved
26 #define exact(x) Exact##x 26 #define exact(x) Exact##x
27 #else 27 #else
28 #define exact(x) DISABLED_Exact##x 28 #define exact(x) DISABLED_Exact##x
29 #endif 29 #endif
30 /* 30 /*
31 * Define a default version as the current version of IE in general release. 31 * Define a default version as the current version of IE in general release.
32 * Predefine on the command line to compile tests for non-standard development e nvironments. 32 * Predefine on the command line to compile tests for non-standard development e nvironments.
33 */ 33 */
34 #ifndef INSTALLED_IE_VERSION 34 #ifndef INSTALLED_IE_VERSION
35 #define INSTALLED_IE_VERSION 11 35 #define INSTALLED_IE_VERSION 11
(...skipping 20 matching lines...) Expand all
56 std::wstring version = AdblockPlus::IE::InstalledVersionString(); 56 std::wstring version = AdblockPlus::IE::InstalledVersionString();
57 std::wstring expected = std::to_wstring(INSTALLED_IE_VERSION) + L"."; 57 std::wstring expected = std::to_wstring(INSTALLED_IE_VERSION) + L".";
58 ASSERT_EQ(expected, version.substr(0, expected.length())); 58 ASSERT_EQ(expected, version.substr(0, expected.length()));
59 } 59 }
60 60
61 TEST(InstalledMajorVersionTest, exact(MajorOnly)) 61 TEST(InstalledMajorVersionTest, exact(MajorOnly))
62 { 62 {
63 int version = AdblockPlus::IE::InstalledMajorVersion(); 63 int version = AdblockPlus::IE::InstalledMajorVersion();
64 ASSERT_EQ(version, INSTALLED_IE_VERSION); 64 ASSERT_EQ(version, INSTALLED_IE_VERSION);
65 } 65 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld