[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / test / TestTextureUtils.cpp
bloba925e38fc9eae18ddc66590f0e7ce80bed08911e
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "TextureDatabase.h"
10 #include "URL.h"
12 #include <gtest/gtest.h>
14 using ::testing::ValuesIn;
16 namespace
18 typedef struct
20 const char *in;
21 const char *type;
22 const char *options;
23 const char *out;
24 } TestFiles;
26 const TestFiles test_files[] = {{ "/path/to/image/file.jpg", "", "", "image://%2fpath%2fto%2fimage%2ffile.jpg/" },
27 { "/path/to/image/file.jpg", "", "size=thumb", "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb" },
28 { "/path/to/video/file.mkv", "video", "", "image://video@%2fpath%2fto%2fvideo%2ffile.mkv/" },
29 { "/path/to/music/file.mp3", "music", "", "image://music@%2fpath%2fto%2fmusic%2ffile.mp3/" },
30 { "image://%2fpath%2fto%2fimage%2ffile.jpg/", "", "", "image://%2fpath%2fto%2fimage%2ffile.jpg/" },
31 { "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb", "", "size=thumb", "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb" }};
34 class TestTextureUtils :
35 public ::testing::TestWithParam<TestFiles>
39 TEST_P(TestTextureUtils, GetWrappedImageURL)
41 const TestFiles &testFiles(GetParam());
43 std::string expected = testFiles.out;
44 std::string out = CTextureUtils::GetWrappedImageURL(testFiles.in,
45 testFiles.type,
46 testFiles.options);
47 EXPECT_EQ(expected, out);
50 INSTANTIATE_TEST_SUITE_P(SampleFiles, TestTextureUtils, ValuesIn(test_files));