本文整理汇总了C++中ErrorInfo::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorInfo::toString方法的具体用法?C++ ErrorInfo::toString怎么用?C++ ErrorInfo::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorInfo
的用法示例。
在下文中一共展示了ErrorInfo::toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testBuildConfigMerging
void TestTools::testBuildConfigMerging()
{
Settings settings((QString()));
TemporaryProfile tp(QLatin1String("tst_tools_profile"), &settings);
Profile profile = tp.p;
profile.setValue(QLatin1String("topLevelKey"), QLatin1String("topLevelValue"));
profile.setValue(QLatin1String("qbs.toolchain"), QLatin1String("gcc"));
profile.setValue(QLatin1String("qbs.architecture"),
QLatin1String("Jean-Claude Pillemann"));
profile.setValue(QLatin1String("cpp.treatWarningsAsErrors"), true);
QVariantMap overrideMap;
overrideMap.insert(QLatin1String("qbs.toolchain"), QLatin1String("clang"));
overrideMap.insert(QLatin1String("qbs.installRoot"), QLatin1String("/blubb"));
SetupProjectParameters params;
params.setTopLevelProfile(profile.name());
params.setConfigurationName(QLatin1String("debug"));
params.setOverriddenValues(overrideMap);
const ErrorInfo error = params.expandBuildConfiguration();
QVERIFY2(!error.hasError(), qPrintable(error.toString()));
const QVariantMap finalMap = params.finalBuildConfigurationTree();
QCOMPARE(finalMap.count(), 3);
QCOMPARE(finalMap.value(QLatin1String("topLevelKey")).toString(),
QString::fromLatin1("topLevelValue"));
const QVariantMap finalQbsMap = finalMap.value(QLatin1String("qbs")).toMap();
QCOMPARE(finalQbsMap.count(), 4);
QCOMPARE(finalQbsMap.value(QLatin1String("toolchain")).toString(),
QString::fromLatin1("clang"));
QCOMPARE(finalQbsMap.value(QLatin1String("configurationName")).toString(),
QString::fromLatin1("debug"));
QCOMPARE(finalQbsMap.value(QLatin1String("architecture")).toString(),
QString::fromLatin1("Jean-Claude Pillemann"));
QCOMPARE(finalQbsMap.value(QLatin1String("installRoot")).toString(), QLatin1String("/blubb"));
const QVariantMap finalCppMap = finalMap.value(QLatin1String("cpp")).toMap();
QCOMPARE(finalCppMap.count(), 1);
QCOMPARE(finalCppMap.value(QLatin1String("treatWarningsAsErrors")).toBool(), true);
}
示例2: exceptionHandler
void TestUpgradeEnv::exceptionHandler(ErrorInfo error)
{
qDebug() << error.toString();
}
示例3: makeTypeError
static void makeTypeError(const ErrorInfo &error, QScriptValue &v)
{
v = v.engine()->currentContext()->throwError(QScriptContext::TypeError,
error.toString());
}