diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-06-02 15:21:39 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-06-02 15:25:03 +0300 |
commit | 44e89fa6151434be24dca38c32b8cb952455f372 (patch) | |
tree | 7d26288f79ace0ee61d6c3870c02f812d6b2982a /vcl | |
parent | adf7df9c021bd0291eb80d1f9e6596d5b9b090c8 (diff) |
Accept also hex vendor id in hex in opengl_blacklist_windows.xml
(And not just names from the hardcoded list.) Surely we want it to be
possible to add a blacklist entry for a hitherto unhandled vendor to
the file at a user site without having to modify the parsing code and
rebuilding LO.
Change-Id: I01ca45cb91df06e1634a565b3e469fb85fe4e116
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/win/blocklist_parser.cxx | 8 | ||||
-rw-r--r-- | vcl/qa/cppunit/blocklistparsertest.cxx | 7 | ||||
-rwxr-xr-x | vcl/qa/cppunit/test_blocklist_parse.xml | 6 |
3 files changed, 18 insertions, 3 deletions
diff --git a/vcl/opengl/win/blocklist_parser.cxx b/vcl/opengl/win/blocklist_parser.cxx index 7c4a526f57ba..eb140a1c47d7 100644 --- a/vcl/opengl/win/blocklist_parser.cxx +++ b/vcl/opengl/win/blocklist_parser.cxx @@ -131,8 +131,12 @@ OUString getVendor(const OString& rString) { return "0x1414"; } - - throw InvalidFileException(); + else + { + // Allow having simply the hex number as such there, too. After all, it's hex numbers that + // are output to opengl_device.log. + return OStringToOUString(rString, RTL_TEXTENCODING_UTF8); + } } uint64_t getVersion(const OString& rString) diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx index 93817fd21d5f..ddad53b94a27 100644 --- a/vcl/qa/cppunit/blocklistparsertest.cxx +++ b/vcl/qa/cppunit/blocklistparsertest.cxx @@ -40,7 +40,7 @@ void BlocklistParserTest::testParse() aBlocklistParser.parse(); size_t const n = aDriveInfos.size(); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(20), n); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(22), n); size_t i = 0; @@ -81,6 +81,11 @@ void BlocklistParserTest::testParse() aDriveInfo = aDriveInfos[i++]; CPPUNIT_ASSERT_EQUAL(bIsWhitelisted, aDriveInfo.mbWhitelisted); + CPPUNIT_ASSERT_EQUAL(OUString("0xcafe"), 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); diff --git a/vcl/qa/cppunit/test_blocklist_parse.xml b/vcl/qa/cppunit/test_blocklist_parse.xml index 65646685aa7d..72ba4059115a 100755 --- a/vcl/qa/cppunit/test_blocklist_parse.xml +++ b/vcl/qa/cppunit/test_blocklist_parse.xml @@ -27,6 +27,9 @@ <entry os="8" vendor="microsoft" compare="not_equal" version="10.20.30.40"> <device id="all"/> </entry> + <entry os="8" vendor="0xcafe" 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> @@ -59,6 +62,9 @@ <entry os="8" vendor="microsoft" compare="not_equal" version="10.20.30.40"> <device id="all"/> </entry> + <entry os="8" vendor="0xcafe" 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> |