summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmwindowstack.cpp
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-08-23 20:07:50 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-08-24 14:20:14 +0200
commit1f35be2f3888b34b4a2f4280c7e0a482bca47640 (patch)
treeb91aa2c77112daf1e512395b466f29583412d4fb /src/plugins/platforms/wasm/qwasmwindowstack.cpp
parent9c66af1f1d2cb8d25546d544e22fd7647227214e (diff)
tests: Fix tst_qprinterinfo for CUPS printer instances
CUPS has a feature called printer instances that allows saving different sets of default options for a single print queue, s. section "Creating Saved Options" at [1]. A printer instance can be set up using e.g. lpoptions -p printer/instance -o name=value The printer instance is then listed with the print queue name and the instance name separated by a slash in the 'lpstat -e' output. Qt also supports CUPS printer instances and displays them using the same as printer names. However, tst_QPrinterInfo::getPrintersFromSystem was previously truncating the printer name at the slash, so the comparison of printer names on a system that has CUPS printer instances set up would fail e.g. as follows: ********* Start testing of tst_QPrinterInfo ********* Config: Using QtTest library 6.5.0, Qt 6.5.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 12.1.0), debian unknown PASS : tst_QPrinterInfo::initTestCase() QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() Test believes Default Printer = "PDF" QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::defaultPrinter() believes Default Printer = "PDF" QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::availablePrinters() believes Default Printer = "PDF" PASS : tst_QPrinterInfo::testForDefaultPrinter() QDEBUG : tst_QPrinterInfo::testForPrinters() Test believes Available Printers = QList("Canon_MX390_series", "PDF", "PDF", "PDF-5cm-margins", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510") QDEBUG : tst_QPrinterInfo::testForPrinters() QPrinterInfo::availablePrinters() believes Available Printers = QList("Canon_MX390_series", "PDF", "PDF-5cm-margins", "PDF/myinstance", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510") FAIL! : tst_QPrinterInfo::testForPrinters() Compared values are not the same Actual (qtPrinters.at(i)) : "PDF-5cm-margins" Expected (testPrinters.at(i)): "PDF" Loc: [/home/michi/development/git/qt5/qtbase/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp(232)] Fix this by adding the slash character to the regex. [1] https://www.cups.org/doc/options.html Change-Id: Id0dc27a8b4c592847ed364cebf277e988039cad4 Reviewed-by: Albert Astals Cid <aacid@kde.org>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindowstack.cpp')
0 files changed, 0 insertions, 0 deletions