vcl/qa/cppunit/blocklistparsertest.cxx | 21 +++++++++++++++++++++ vcl/qa/cppunit/test_blocklist_vulkan.xml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+)
New commits: commit 2fb4bb03b4c2ee4f28f3b9e755ee2298d42ac8b9 Author: Luboš Luňák <[email protected]> AuthorDate: Mon Sep 21 14:44:32 2020 +0000 Commit: Luboš Luňák <[email protected]> CommitDate: Tue Sep 29 09:56:19 2020 +0200 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 <[email protected]> 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> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
