10 #include <QtTest/QtTest>
14 void DeviceInfoTest::testAdaptationVariables()
17 QHash<QString, QString> variables;
18 QHash<QString, QString> variablesExpected;
19 variablesExpected[
"adaptation"] =
"n950-n9";
20 variablesExpected[
"foo-n9"] =
"foo-n9-val";
21 variablesExpected[
"foo-n950-n9"] =
"foo-n950-n9-val";
23 QString repoName = deviceInfo.adaptationVariables(
"adaptation1", &variables);
25 QCOMPARE(variables, variablesExpected);
26 QCOMPARE(repoName, QString(
"adaptation"));
29 void DeviceInfoTest::testFeatureVariables()
32 QHash<QString, QString> featureVariables;
33 QString repoName = deviceInfo.adaptationVariables(
"feature1", &featureVariables);
34 QHash<QString, QString> featureVariablesExpected;
35 featureVariablesExpected[
"feature"] =
"test";
36 QCOMPARE(featureVariables, featureVariablesExpected);
37 QCOMPARE(repoName, QString(
"feature1"));
40 void DeviceInfoTest::testDeviceUid()
42 QVERIFY2(!
SsuDeviceInfo().deviceUid().isEmpty(),
"No method to get device UID on this platform");
45 void DeviceInfoTest::testVariableSection()
49 QHash<QString, QString> fooVars;
50 QHash<QString, QString> fooVarsExpected;
51 fooVarsExpected[
"foo1"] =
"foo1Val";
52 fooVarsExpected[
"foo2"] =
"foo2Val";
56 QCOMPARE(fooVars, fooVarsExpected);
58 QHash<QString, QString> barVars;
59 QHash<QString, QString> barVarsExpected;
60 barVarsExpected[
"bar1"] =
"bar1Val";
61 barVarsExpected[
"bar2"] =
"bar2Val";
65 QCOMPARE(barVars, barVarsExpected);
67 QHash<QString, QString> bazVars;
68 QHash<QString, QString> bazVarsExpected;
69 bazVarsExpected[
"foo1"] =
"foo1Val";
70 bazVarsExpected[
"foo2"] =
"foo2Val";
71 bazVarsExpected[
"bar1"] =
"bar1Val";
72 bazVarsExpected[
"bar2"] =
"bar2Val";
76 QCOMPARE(bazVars, bazVarsExpected);
79 void DeviceInfoTest::testValue()
82 QCOMPARE(deviceInfo.
value(
"family").toString(), QString(
"n950-n9"));
83 QCOMPARE(deviceInfo.
value(
"adaptation-repos").toStringList(),
84 QString(
"n9xx-common,n950-n9").split(
','));
85 QCOMPARE(deviceInfo.
value(
"foo").toString(), QString(
"n950-foo"));