summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2016-02-15 15:10:03 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-02-16 08:36:16 +0000
commit2f496d6a1e83ec234ce7479c5397c04dc126b12c (patch)
tree8eb6da7110045edf780f16ec87527588ab04ceac
parentsw: ensure that configuration change in odfexporttest.cxx ... (diff)
downloadcore-2f496d6a1e83ec234ce7479c5397c04dc126b12c.tar.gz
core-2f496d6a1e83ec234ce7479c5397c04dc126b12c.zip
Unit test for opengl blocklist parsing and evaluating
Parsing unit test checks that the xml values are parsed correctly and that the DriverInfo structure is populated with the expected values. Evaluate unit test checks that blacklisting / whitelisting logic blocks OS/vendor/driver/device as expected. Change-Id: Ib1b0926606f0835207c324193bbe19ba83f86bdc Reviewed-on: https://gerrit.libreoffice.org/22377 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--vcl/CppunitTest_vcl_blocklistparser_test.mk49
-rw-r--r--vcl/Module_vcl.mk1
-rw-r--r--vcl/inc/opengl/win/WinDeviceInfo.hxx14
-rw-r--r--vcl/inc/opengl/win/blocklist_parser.hxx (renamed from vcl/opengl/win/blocklist_parser.hxx)8
-rw-r--r--vcl/opengl/win/WinDeviceInfo.cxx57
-rw-r--r--vcl/opengl/win/blocklist_parser.cxx2
-rw-r--r--vcl/qa/cppunit/blocklistparsertest.cxx161
-rwxr-xr-xvcl/qa/cppunit/test_blocklist_evaluate.xml47
-rwxr-xr-xvcl/qa/cppunit/test_blocklist_parse.xml75
9 files changed, 379 insertions, 35 deletions
diff --git a/vcl/CppunitTest_vcl_blocklistparser_test.mk b/vcl/CppunitTest_vcl_blocklistparser_test.mk
new file mode 100644
index 000000000000..95b75076b32b
--- /dev/null
+++ b/vcl/CppunitTest_vcl_blocklistparser_test.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,vcl_blocklistparser_test))
+
+$(eval $(call gb_CppunitTest_set_include,vcl_blocklistparser_test,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/vcl/inc \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,vcl_blocklistparser_test, \
+ vcl/qa/cppunit/blocklistparsertest \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,vcl_blocklistparser_test,\
+ boost_headers \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,vcl_blocklistparser_test, \
+ sal \
+ test \
+ unotest \
+ vcl \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,vcl_blocklistparser_test,\
+ udkapi \
+ offapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,vcl_blocklistparser_test))
+$(eval $(call gb_CppunitTest_use_vcl,vcl_blocklistparser_test))
+
+$(eval $(call gb_CppunitTest_use_components,vcl_blocklistparser_test,\
+ configmgr/source/configmgr \
+ i18npool/util/i18npool \
+ ucb/source/core/ucb1 \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,vcl_blocklistparser_test))
+
+# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 1480504c72bb..90a16b39f076 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -121,6 +121,7 @@ endif
ifeq ($(OS),WNT)
$(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_timer \
+ CppunitTest_vcl_blocklistparser_test \
))
endif
# vim: set noet sw=4 ts=4:
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 974d6b312f7d..8dcbd553dfe9 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -10,7 +10,10 @@
#ifndef INCLUDED_VCL_OPENGL_WIN_WINDEVICEINFO_HXX
#define INCLUDED_VCL_OPENGL_WIN_WINDEVICEINFO_HXX
+#include <vcl/dllapi.h>
+
#include "opengl/DeviceInfo.hxx"
+
#include <rtl/ustring.hxx>
#include <vector>
#include <cstdint>
@@ -60,14 +63,14 @@ enum DeviceVendor {
bool ParseDriverVersion(const OUString& rString, uint64_t& rVersion);
-struct DriverInfo
+struct VCL_DLLPUBLIC DriverInfo
{
DriverInfo(OperatingSystem os, const OUString& vendor, VersionComparisonOp op,
uint64_t driverVersion, bool bWhiteListed = false, const char *suggestedVersion = nullptr);
DriverInfo();
- ~DriverInfo();
+ virtual ~DriverInfo();
OperatingSystem meOperatingSystem;
uint32_t mnOperatingSystemVersion;
@@ -96,7 +99,7 @@ struct DriverInfo
#define GFX_DRIVER_VERSION(a,b,c,d) \
((uint64_t(a)<<48) | (uint64_t(b)<<32) | (uint64_t(c)<<16) | uint64_t(d))
-inline uint64_t V(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
+inline VCL_DLLPUBLIC uint64_t V(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
{
// We make sure every driver number is padded by 0s, this will allow us the
// easiest 'compare as if decimals' approach. See ParseDriverVersion for a
@@ -115,7 +118,7 @@ inline uint64_t V(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
}
-class WinOpenGLDeviceInfo : public OpenGLDeviceInfo
+class VCL_DLLPUBLIC WinOpenGLDeviceInfo : public OpenGLDeviceInfo
{
private:
OUString maDriverVersion;
@@ -204,6 +207,9 @@ public:
return mnWindowsVersion;
}
+ static bool FindBlocklistedDeviceInList(std::vector<wgl::DriverInfo>& aDeviceInfos,
+ OUString sDriverVersion, OUString sAdapterVendorID,
+ OUString sAdapterDeviceID, uint32_t nWindowsVersion);
};
#endif
diff --git a/vcl/opengl/win/blocklist_parser.hxx b/vcl/inc/opengl/win/blocklist_parser.hxx
index bc2e2a14baa7..f30734436f22 100644
--- a/vcl/opengl/win/blocklist_parser.hxx
+++ b/vcl/inc/opengl/win/blocklist_parser.hxx
@@ -7,17 +7,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "opengl/win/WinDeviceInfo.hxx"
-
+#include <vcl/dllapi.h>
#include <xmlreader/xmlreader.hxx>
-
#include <vector>
+#include "opengl/win/WinDeviceInfo.hxx"
class InvalidFileException
{
};
-class WinBlocklistParser
+class VCL_DLLPUBLIC WinBlocklistParser
{
public:
WinBlocklistParser(const OUString& rURL, std::vector<wgl::DriverInfo>& rDriverList);
@@ -29,7 +28,6 @@ private:
void handleList(xmlreader::XmlReader& rReader);
void handleContent(xmlreader::XmlReader& rReader);
-
enum class BlockType
{
WHITELIST,
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index 3f226c31cfa3..1cb85da3f5ed 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -9,7 +9,7 @@
#include "opengl/win/WinDeviceInfo.hxx"
-#include "blocklist_parser.hxx"
+#include "opengl/win/blocklist_parser.hxx"
#include <config_folders.h>
#include <windows.h>
@@ -451,67 +451,69 @@ private:
}
-bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
+bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(std::vector<wgl::DriverInfo>& aDeviceInfos,
+ OUString sDriverVersion, OUString sAdapterVendorID,
+ OUString sAdapterDeviceID, uint32_t nWindowsVersion)
{
uint64_t driverVersion;
- wgl::ParseDriverVersion(maDriverVersion, driverVersion);
+ wgl::ParseDriverVersion(sDriverVersion, driverVersion);
- wgl::OperatingSystem eOS = WindowsVersionToOperatingSystem(mnWindowsVersion);
+ wgl::OperatingSystem eOS = WindowsVersionToOperatingSystem(nWindowsVersion);
bool match = false;
uint32_t i = 0;
- for (; i < maDriverInfo.size(); i++)
+ for (; i < aDeviceInfos.size(); i++)
{
- if (maDriverInfo[i].meOperatingSystem != wgl::DRIVER_OS_ALL &&
- maDriverInfo[i].meOperatingSystem != eOS)
+ if (aDeviceInfos[i].meOperatingSystem != wgl::DRIVER_OS_ALL &&
+ aDeviceInfos[i].meOperatingSystem != eOS)
{
continue;
}
- if (maDriverInfo[i].mnOperatingSystemVersion && maDriverInfo[i].mnOperatingSystemVersion != mnWindowsVersion)
+ if (aDeviceInfos[i].mnOperatingSystemVersion && aDeviceInfos[i].mnOperatingSystemVersion != nWindowsVersion)
{
continue;
}
- if (!maDriverInfo[i].maAdapterVendor.equalsIgnoreAsciiCase(GetDeviceVendor(wgl::VendorAll)) &&
- !maDriverInfo[i].maAdapterVendor.equalsIgnoreAsciiCase(maAdapterVendorID))
+ if (!aDeviceInfos[i].maAdapterVendor.equalsIgnoreAsciiCase(GetDeviceVendor(wgl::VendorAll)) &&
+ !aDeviceInfos[i].maAdapterVendor.equalsIgnoreAsciiCase(sAdapterVendorID))
{
continue;
}
- if (std::none_of(maDriverInfo[i].maDevices.begin(), maDriverInfo[i].maDevices.end(), compareIgnoreAsciiCase("all")) &&
- std::none_of(maDriverInfo[i].maDevices.begin(), maDriverInfo[i].maDevices.end(), compareIgnoreAsciiCase(maAdapterDeviceID)))
+ if (std::none_of(aDeviceInfos[i].maDevices.begin(), aDeviceInfos[i].maDevices.end(), compareIgnoreAsciiCase("all")) &&
+ std::none_of(aDeviceInfos[i].maDevices.begin(), aDeviceInfos[i].maDevices.end(), compareIgnoreAsciiCase(sAdapterDeviceID)))
{
continue;
}
- switch (maDriverInfo[i].meComparisonOp)
+ switch (aDeviceInfos[i].meComparisonOp)
{
case wgl::DRIVER_LESS_THAN:
- match = driverVersion < maDriverInfo[i].mnDriverVersion;
+ match = driverVersion < aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_LESS_THAN_OR_EQUAL:
- match = driverVersion <= maDriverInfo[i].mnDriverVersion;
+ match = driverVersion <= aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_GREATER_THAN:
- match = driverVersion > maDriverInfo[i].mnDriverVersion;
+ match = driverVersion > aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_GREATER_THAN_OR_EQUAL:
- match = driverVersion >= maDriverInfo[i].mnDriverVersion;
+ match = driverVersion >= aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_EQUAL:
- match = driverVersion == maDriverInfo[i].mnDriverVersion;
+ match = driverVersion == aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_NOT_EQUAL:
- match = driverVersion != maDriverInfo[i].mnDriverVersion;
+ match = driverVersion != aDeviceInfos[i].mnDriverVersion;
break;
case wgl::DRIVER_BETWEEN_EXCLUSIVE:
- match = driverVersion > maDriverInfo[i].mnDriverVersion && driverVersion < maDriverInfo[i].mnDriverVersionMax;
+ match = driverVersion > aDeviceInfos[i].mnDriverVersion && driverVersion < aDeviceInfos[i].mnDriverVersionMax;
break;
case wgl::DRIVER_BETWEEN_INCLUSIVE:
- match = driverVersion >= maDriverInfo[i].mnDriverVersion && driverVersion <= maDriverInfo[i].mnDriverVersionMax;
+ match = driverVersion >= aDeviceInfos[i].mnDriverVersion && driverVersion <= aDeviceInfos[i].mnDriverVersionMax;
break;
case wgl::DRIVER_BETWEEN_INCLUSIVE_START:
- match = driverVersion >= maDriverInfo[i].mnDriverVersion && driverVersion < maDriverInfo[i].mnDriverVersionMax;
+ match = driverVersion >= aDeviceInfos[i].mnDriverVersion && driverVersion < aDeviceInfos[i].mnDriverVersionMax;
break;
case wgl::DRIVER_COMPARISON_IGNORED:
// We don't have a comparison op, so we match everything.
@@ -522,17 +524,17 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
break;
}
- if (match || maDriverInfo[i].mnDriverVersion == wgl::DriverInfo::allDriverVersions)
+ if (match || aDeviceInfos[i].mnDriverVersion == wgl::DriverInfo::allDriverVersions)
{
// white listed drivers
- if (maDriverInfo[i].mbWhitelisted)
+ if (aDeviceInfos[i].mbWhitelisted)
{
SAL_WARN("vcl.opengl", "whitelisted driver");
return false;
}
match = true;
- SAL_WARN("vcl.opengl", "use : " << maDriverInfo[i].maSuggestedVersion);
+ SAL_WARN("vcl.opengl", "use : " << aDeviceInfos[i].maSuggestedVersion);
break;
}
}
@@ -541,6 +543,11 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
return match;
}
+bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
+{
+ return FindBlocklistedDeviceInList(maDriverInfo, maDriverVersion, maAdapterVendorID, maAdapterDeviceID, mnWindowsVersion);
+}
+
namespace {
OUString getCacheFolder()
diff --git a/vcl/opengl/win/blocklist_parser.cxx b/vcl/opengl/win/blocklist_parser.cxx
index 7a8d01229eb8..119732abe11c 100644
--- a/vcl/opengl/win/blocklist_parser.cxx
+++ b/vcl/opengl/win/blocklist_parser.cxx
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "blocklist_parser.hxx"
+#include "opengl/win/blocklist_parser.hxx"
WinBlocklistParser::WinBlocklistParser(const OUString& rURL,
std::vector<wgl::DriverInfo>& rDriverList)
diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx
new file mode 100644
index 000000000000..66a4f7051651
--- /dev/null
+++ b/vcl/qa/cppunit/blocklistparsertest.cxx
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <sal/types.h>
+
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+
+#include <unotest/bootstrapfixturebase.hxx>
+
+#include "opengl/win/blocklist_parser.hxx"
+
+namespace
+{
+
+class BlocklistParserTest : public test::BootstrapFixtureBase
+{
+ void testParse();
+ void testEvaluate();
+
+ CPPUNIT_TEST_SUITE(BlocklistParserTest);
+ CPPUNIT_TEST(testParse);
+ CPPUNIT_TEST(testEvaluate);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+void BlocklistParserTest::testParse()
+{
+ std::vector<wgl::DriverInfo> aDriveInfos;
+
+ WinBlocklistParser aBlocklistParser(getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_parse.xml", aDriveInfos);
+ aBlocklistParser.parse();
+
+ CPPUNIT_ASSERT_EQUAL(20U, aDriveInfos.size());
+
+ size_t i = 0;
+
+ for (bool bIsWhitelisted : {true, false})
+ {
+ wgl::DriverInfo& aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAll), aDriveInfo.maAdapterVendor); // "all"
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_LESS_THAN, aDriveInfo.meComparisonOp);
+ CPPUNIT_ASSERT_EQUAL(wgl::V(10,20,30,40), aDriveInfo.mnDriverVersion);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorIntel), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_LESS_THAN_OR_EQUAL, aDriveInfo.meComparisonOp);
+ CPPUNIT_ASSERT_EQUAL(wgl::V(11,21,31,41), aDriveInfo.mnDriverVersion);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorATI), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_GREATER_THAN, aDriveInfo.meComparisonOp);
+ CPPUNIT_ASSERT_EQUAL(wgl::V(12,22,32,42), aDriveInfo.mnDriverVersion);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAMD), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_GREATER_THAN_OR_EQUAL, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorNVIDIA), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_EQUAL, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorMicrosoft), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_NOT_EQUAL, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAll), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_BETWEEN_EXCLUSIVE, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAll), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_BETWEEN_INCLUSIVE, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAll), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_BETWEEN_INCLUSIVE_START, aDriveInfo.meComparisonOp);
+
+ aDriveInfo = aDriveInfos[i++];
+ CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted);
+ CPPUNIT_ASSERT_EQUAL(WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAll), aDriveInfo.maAdapterVendor);
+ CPPUNIT_ASSERT_EQUAL(wgl::VersionComparisonOp::DRIVER_COMPARISON_IGNORED, aDriveInfo.meComparisonOp);
+ }
+}
+
+void BlocklistParserTest::testEvaluate()
+{
+ std::vector<wgl::DriverInfo> aDriveInfos;
+
+ WinBlocklistParser aBlocklistParser(getURLFromSrc("vcl/qa/cppunit/") + "test_blocklist_evaluate.xml", aDriveInfos);
+ aBlocklistParser.parse();
+
+ OUString vendorAMD = WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorAMD);
+ OUString vendorNVIDIA = WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorNVIDIA);
+ OUString vendorIntel = WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorIntel);
+ OUString vendorMicrosoft = WinOpenGLDeviceInfo::GetDeviceVendor(wgl::VendorMicrosoft);
+
+ uint32_t osWindowsXP = 0x00050001;
+ uint32_t osWindowsVista = 0x00060000;
+ uint32_t osWindows7 = 0x00060001;
+ uint32_t osWindows8 = 0x00060002;
+ uint32_t osWindows10 = 0x000A0000;
+
+ // Check OS
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorNVIDIA, "all", osWindowsXP));
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorNVIDIA, "all", osWindowsVista));
+ CPPUNIT_ASSERT_EQUAL(false, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorNVIDIA, "all", osWindows7));
+ CPPUNIT_ASSERT_EQUAL(false, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorNVIDIA, "all", osWindows8));
+ CPPUNIT_ASSERT_EQUAL(false, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorNVIDIA, "all", osWindows10));
+
+
+ // Check Vendors
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorMicrosoft, "all", osWindows7));
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorMicrosoft, "all", osWindows10));
+
+ // Check Versions
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.39", vendorAMD, "all", osWindows7));
+ CPPUNIT_ASSERT_EQUAL(false, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.40", vendorAMD, "all", osWindows7));
+ CPPUNIT_ASSERT_EQUAL(false, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "10.20.30.41", vendorAMD, "all", osWindows7));
+
+ // Check
+ CPPUNIT_ASSERT_EQUAL(true, WinOpenGLDeviceInfo::FindBlocklistedDeviceInList(
+ aDriveInfos, "9.17.10.4229", vendorIntel, "all", osWindows7));
+
+
+}
+
+} // namespace
+
+CPPUNIT_TEST_SUITE_REGISTRATION(BlocklistParserTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/test_blocklist_evaluate.xml b/vcl/qa/cppunit/test_blocklist_evaluate.xml
new file mode 100755
index 000000000000..7ffbe3a1b588
--- /dev/null
+++ b/vcl/qa/cppunit/test_blocklist_evaluate.xml
@@ -0,0 +1,47 @@
+<?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", "xp", "server2003", "vista", "7", "8", "8_1", "10"
+ vendor - "all", "intel", "ati", "amd", "nvidia", "microsoft"
+ compare - "less", "less_equal", "greater", "greater_equal", "equal", "not_equal", "between_exclusive", "between_inclusive", "between_inclusive_start"
+ version
+ minVersion
+ maxVersion
+-->
+
+<root>
+ <whitelist>
+ </whitelist>
+ <blacklist>
+ <entry os="xp" vendor="all">
+ <device id="all"/>
+ </entry>
+ <entry os="server2003" vendor="all">
+ <device id="all"/>
+ </entry>
+ <entry os="vista" vendor="all">
+ <device id="all"/>
+ </entry>
+
+ <entry os="all" vendor="amd" compare="less" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+
+ <entry os="all" vendor="microsoft">
+ <device id="all"/>
+ </entry>
+
+ <entry os="all" vendor="intel" compare="less" version="10.18.14.4264">
+ <device id="all"/>
+ </entry>
+
+ </blacklist>
+</root>
diff --git a/vcl/qa/cppunit/test_blocklist_parse.xml b/vcl/qa/cppunit/test_blocklist_parse.xml
new file mode 100755
index 000000000000..65646685aa7d
--- /dev/null
+++ b/vcl/qa/cppunit/test_blocklist_parse.xml
@@ -0,0 +1,75 @@
+<?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/.
+-->
+
+<root>
+ <whitelist>
+ <entry os="all" vendor="all" compare="less" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="xp" vendor="intel" compare="less_equal" version="11.21.31.41">
+ <device id="all"/>
+ </entry>
+ <entry os="server2003" vendor="ati" compare="greater" version="12.22.32.42">
+ <device id="all"/>
+ </entry>
+ <entry os="vista" vendor="amd" compare="greater_equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="7" vendor="nvidia" compare="equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="8" vendor="microsoft" compare="not_equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="8_1" compare="between_exclusive" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="10" compare="between_inclusive" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="all" compare="between_inclusive_start" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="all">
+ <device id="all"/>
+ </entry>
+ </whitelist>
+ <blacklist>
+ <entry os="all" vendor="all" compare="less" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="xp" vendor="intel" compare="less_equal" version="11.21.31.41">
+ <device id="all"/>
+ </entry>
+ <entry os="server2003" vendor="ati" compare="greater" version="12.22.32.42">
+ <device id="all"/>
+ </entry>
+ <entry os="vista" vendor="amd" compare="greater_equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="7" vendor="nvidia" compare="equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="8" vendor="microsoft" compare="not_equal" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="8_1" compare="between_exclusive" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="10" compare="between_inclusive" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="all" compare="between_inclusive_start" version="10.20.30.40">
+ <device id="all"/>
+ </entry>
+ <entry os="all">
+ <device id="all"/>
+ </entry>
+ </blacklist>
+</root>