summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2020-09-21 14:44:32 +0000
committerLuboš Luňák <l.lunak@collabora.com>2020-09-29 09:56:19 +0200
commit2fb4bb03b4c2ee4f28f3b9e755ee2298d42ac8b9 (patch)
tree25bacb55d82be11fb139dff81b65a27b345c1836 /vcl
parent6f224a17dbf635319503a81ce4038b1ae2ad6de0 (diff)
add test for 'fix parsing of Vulkan version numbers'
Change-Id: I0b7195153354324a95ab438a35186660f1ea65a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103563 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/blocklistparsertest.cxx21
-rw-r--r--vcl/qa/cppunit/test_blocklist_vulkan.xml30
2 files changed, 51 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx
index 540cbe436887..e9c6622e36a9 100644
--- a/vcl/qa/cppunit/blocklistparsertest.cxx
+++ b/vcl/qa/cppunit/blocklistparsertest.cxx
@@ -27,10 +27,12 @@ class BlocklistParserTest : public test::BootstrapFixtureBase
{
void testParse();
void testEvaluate();
+ void testVulkan();
CPPUNIT_TEST_SUITE(BlocklistParserTest);
CPPUNIT_TEST(testParse);
CPPUNIT_TEST(testEvaluate);
+ CPPUNIT_TEST(testVulkan);
CPPUNIT_TEST_SUITE_END();
};
@@ -135,6 +137,25 @@ void BlocklistParserTest::testEvaluate()
}
+void BlocklistParserTest::testVulkan()
+{
+ std::vector<DriverInfo> aDriveInfos;
+
+ Parser aBlocklistParser(m_directories.getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_vulkan.xml",
+ aDriveInfos, VersionType::Vulkan);
+ aBlocklistParser.parse();
+
+ OUString vendorAMD = GetVendorId(VendorAMD);
+
+ // Check Versions
+ CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::Vulkan, "1.2.3", vendorAMD, "all", DRIVER_OS_ALL));
+ CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::Vulkan, "1.2.2", vendorAMD, "all", DRIVER_OS_ALL));
+ CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::Vulkan, "1.2.20", vendorAMD, "all", DRIVER_OS_ALL));
+}
+
} // namespace
CPPUNIT_TEST_SUITE_REGISTRATION(BlocklistParserTest);
diff --git a/vcl/qa/cppunit/test_blocklist_vulkan.xml b/vcl/qa/cppunit/test_blocklist_vulkan.xml
new file mode 100644
index 000000000000..9542ee5f22a5
--- /dev/null
+++ b/vcl/qa/cppunit/test_blocklist_vulkan.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+-->
+
+<!--
+ entry attributes:
+ os - "all", "7", "8", "8_1", "10"
+ vendor - "all", "intel", "amd", "nvidia", "microsoft"
+ compare - "less", "less_equal", "greater", "greater_equal", "equal", "not_equal", "between_exclusive", "between_inclusive", "between_inclusive_start"
+ version
+ minVersion
+ maxVersion
+-->
+
+<root>
+ <allowlist>
+ </allowlist>
+ <denylist>
+
+ <entry os="all" vendor="amd" compare="less" version="1.2.3">
+ <device id="all"/>
+ </entry>
+
+ </denylist>
+</root>