| OLD | NEW | 
| (Empty) |  | 
 |   1 /* | 
 |   2  * This file is part of Adblock Plus <https://adblockplus.org/>, | 
 |   3  * Copyright (C) 2006-2015 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  */ | 
 |  17  | 
 |  18 #include <gtest/gtest.h> | 
 |  19 #include "../src/shared/Utils.h" | 
 |  20  | 
 |  21 // Tests are in the following order | 
 |  22 // x ? x # x | 
 |  23 // 1 0 0 0 0 | 
 |  24 // 1 0 0 0 1 - the same as 10000 | 
 |  25 // 1 0 0 1 0 | 
 |  26 // 1 0 0 1 1 | 
 |  27 // 1 0 1 0 0 - the same as 10000 | 
 |  28 // 1 0 1 0 1 - the same as 10000 | 
 |  29 // 1 0 1 1 0 - the same as 10010 | 
 |  30 // 1 0 1 1 1 - the same as 10011 | 
 |  31 // 1 1 0 0 0 | 
 |  32 // 1 1 0 0 1 - the same as 11100 | 
 |  33 // 1 1 0 1 0 | 
 |  34 // 1 1 0 1 1 | 
 |  35 // 1 1 1 0 0 | 
 |  36 // 1 1 1 0 1 - the same as 11100 | 
 |  37 // 1 1 1 1 0 | 
 |  38 // 1 1 1 1 1 | 
 |  39  | 
 |  40 TEST(GetQueryStringTest, URL_10000) | 
 |  41 { | 
 |  42   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2")); | 
 |  43 } | 
 |  44  | 
 |  45 TEST(GetQueryStringTest, URL_10010) | 
 |  46 { | 
 |  47   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2#")); | 
 |  48 } | 
 |  49  | 
 |  50 TEST(GetQueryStringTest, URL_10011) | 
 |  51 { | 
 |  52   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2#fragment")); | 
 |  53 } | 
 |  54  | 
 |  55 TEST(GetQueryStringTest, URL_11000) | 
 |  56 { | 
 |  57   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2?")); | 
 |  58 } | 
 |  59  | 
 |  60 TEST(GetQueryStringTest, URL_11010) | 
 |  61 { | 
 |  62   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2?#")); | 
 |  63 } | 
 |  64  | 
 |  65 TEST(GetQueryStringTest, URL_11011) | 
 |  66 { | 
 |  67   EXPECT_EQ(L"", GetQueryString(L"schema://host/path1/path2?#fragment")); | 
 |  68 } | 
 |  69  | 
 |  70 TEST(GetQueryStringTest, URL_11100) | 
 |  71 { | 
 |  72   EXPECT_EQ(L"queryString", GetQueryString(L"schema://host/path1/path2?queryStri
    ng")); | 
 |  73 } | 
 |  74  | 
 |  75 TEST(GetQueryStringTest, URL_11110) | 
 |  76 { | 
 |  77   EXPECT_EQ(L"queryString=value", GetQueryString(L"schema://host/path1/path2?que
    ryString=value#")); | 
 |  78 } | 
 |  79  | 
 |  80 TEST(GetQueryStringTest, URL_11111) | 
 |  81 { | 
 |  82   EXPECT_EQ(L"queryString=value", GetQueryString(L"schema://host/path1/path2?que
    ryString=value#fragment")); | 
 |  83 } | 
 |  84  | 
| OLD | NEW |