| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 Loading... | |
| 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 } |
| LEFT | RIGHT |