summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/test/TestScraperUrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/test/TestScraperUrl.cpp')
-rw-r--r--xbmc/utils/test/TestScraperUrl.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/xbmc/utils/test/TestScraperUrl.cpp b/xbmc/utils/test/TestScraperUrl.cpp
new file mode 100644
index 0000000..1feb181
--- /dev/null
+++ b/xbmc/utils/test/TestScraperUrl.cpp
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#include "utils/ScraperUrl.h"
10
11#include <gtest/gtest.h>
12
13TEST(TestScraperUrl, General)
14{
15 CScraperUrl a;
16 std::string xmlstring;
17
18 xmlstring = "<data spoof=\"blah\" gzip=\"yes\">\n"
19 " <someurl>\n"
20 " </someurl>\n"
21 " <someotherurl>\n"
22 " </someotherurl>\n"
23 "</data>\n";
24 EXPECT_TRUE(a.ParseFromData(xmlstring));
25
26 const auto url = a.GetFirstUrlByType();
27 EXPECT_STREQ("blah", url.m_spoof.c_str());
28 EXPECT_STREQ("someurl", url.m_url.c_str());
29 EXPECT_STREQ("", url.m_cache.c_str());
30 EXPECT_EQ(CScraperUrl::UrlType::General, url.m_type);
31 EXPECT_FALSE(url.m_post);
32 EXPECT_TRUE(url.m_isgz);
33 EXPECT_EQ(-1, url.m_season);
34}