本文整理汇总了C++中TaskManager::getTarsnapVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskManager::getTarsnapVersion方法的具体用法?C++ TaskManager::getTarsnapVersion怎么用?C++ TaskManager::getTarsnapVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskManager
的用法示例。
在下文中一共展示了TaskManager::getTarsnapVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_version
void TestTaskManager::get_version()
{
TARSNAP_CLI_OR_SKIP;
TaskManager *manager = new TaskManager();
QSignalSpy sig_ver(manager, SIGNAL(tarsnapVersion(QString)));
QString ver_str;
// We start off with no version signal.
QVERIFY(sig_ver.count() == 0);
// Get version number
manager->getTarsnapVersion("");
QTest::qWait(TASK_CMDLINE_WAIT_MS);
QVERIFY(sig_ver.count() == 1);
ver_str = sig_ver.takeFirst().at(0).toString();
// Verify that it's a real version number
for(const QString &part : ver_str.split("."))
{
for(int i = 0; i < part.size(); i++)
{
QVERIFY(part[i].isDigit());
}
}
// Get a failure
manager->getTarsnapVersion("fake-dir");
QTest::qWait(TASK_CMDLINE_WAIT_MS);
QVERIFY(sig_ver.count() == 1);
ver_str = sig_ver.takeFirst().at(0).toString();
QVERIFY(ver_str.isEmpty());
delete manager;
}
示例2: initTestCase
void TestTaskManager::initTestCase()
{
QCoreApplication::setOrganizationName(TEST_NAME);
ConsoleLog::initializeConsoleLog();
// This is to "warm up" the command-line tasks.
TaskManager *manager = new TaskManager();
QSignalSpy sig_ver(manager, SIGNAL(tarsnapVersion(QString)));
manager->getTarsnapVersion("");
// Wait for task to finish
while(sig_ver.count() == 0)
QTest::qWait(TASK_CMDLINE_WAIT_MS);
delete manager;
}