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.
9 #include "TextureDatabase.h"
12 #include <gtest/gtest.h>
14 using ::testing::ValuesIn
;
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
,
47 EXPECT_EQ(expected
, out
);
50 INSTANTIATE_TEST_SUITE_P(SampleFiles
, TestTextureUtils
, ValuesIn(test_files
));