MCPcopy Create free account
hub / github.com/TeXworks/texworks / ResourcesLibrary_getLibraryPath_data

Method ResourcesLibrary_getLibraryPath_data

unit-tests/Utils_test.cpp:627–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void TestUtils::ResourcesLibrary_getLibraryPath_data()
628{
629 QTest::addColumn<QString>("portableLibPath");
630 QTest::addColumn<QString>("subdir");
631 QTest::addColumn<QString>("result");
632
633 const QString sConfig(QStringLiteral("configuration"));
634 const QString sDicts(QStringLiteral("dictionaries"));
635 const QString sInvalid(QStringLiteral("does-not-exist"));
636
637#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
638 QString stem = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/");
639#else
640 QString stem = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/");
641#endif
642
643 QTest::newRow("root") << QString() << QString() << stem;
644 QTest::newRow("configuration") << QString() << sConfig << stem + sConfig;
645 QTest::newRow("does-not-exist") << QString() << sInvalid << stem + sInvalid;
646#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) // *nix
647# ifndef TW_DICPATH
648 QTest::newRow("dictionaries") << QString() << sDicts << QStringLiteral("/usr/share/hunspell:/usr/share/myspell/dicts");
649# else
650 QTest::newRow("dictionaries") << QString() << sDicts << TW_DICPATH;
651# endif
652#else // not *nix
653 QTest::newRow("dictionaries") << QString() << sDicts << stem + sDicts;
654#endif
655
656 stem = "/invented/portable/root/";
657 QTest::newRow("portable-root") << stem << QString() << stem;
658 QTest::newRow("portable-configuration") << stem << sConfig << stem + sConfig;
659 QTest::newRow("portable-does-not-exist") << stem << sInvalid << stem + sInvalid;
660 QTest::newRow("portable-dictionaries") << stem << sDicts << stem + sDicts;
661}
662
663void TestUtils::ResourcesLibrary_getLibraryPath()
664{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected