on xenial help sign in
Added check for model create
1a54052Nick Dedekind
tests/plugins/Unity/Indicators/sharedunitymenumodeltest.cpp+14−5
@@ -34,27 +34,35 @@ class SharedUnityMenuModelTest : public QObject
34 actions["test"] = QString("/com/canonical/%1/actions").arg(QString(testId));
34 actions["test"] = QString("/com/canonical/%1/actions").arg(QString(testId));
35 model->setActions(actions);
35 model->setActions(actions);
36
36
37−// QVERIFY(model->model() != nullptr);
38 return model;
37 return model;
39 }
38 }
40
39
41private Q_SLOTS:
40private Q_SLOTS:
42
41
42+ void testCreateModel()
43+ {
44+ QSharedPointer<SharedUnityMenuModel> model(createFullModel("test1"));
45+ QVERIFY(model->model() != nullptr);
46+ }
47+
43− void testDifferentDataCreatesDifferentModels() {
48+ void testDifferentDataCreatesDifferentModels()
49+ {
44 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
50 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
45 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test2"));
51 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test2"));
46
52
47 QVERIFY(model1->model() != model2->model());
53 QVERIFY(model1->model() != model2->model());
48 }
54 }
49
55
50− void testSameDataCreatesSameModels() {
56+ void testSameDataCreatesSameModels()
57+ {
51 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
58 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
52 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
59 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
53
60
54 QCOMPARE(model1->model(), model2->model());
61 QCOMPARE(model1->model(), model2->model());
55 }
62 }
56
63
57− void testSharedOwnership() {
64+ void testSharedOwnership()
65+ {
58 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
66 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
59 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
67 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
60
68
@@ -66,7 +74,8 @@ private Q_SLOTS:
66 }
74 }
67
75
68 // Tests that changing cached model data does not change the model path of others
76 // Tests that changing cached model data does not change the model path of others
69− void testLP1328646() {
77+ void testLP1328646()
78+ {
70 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
79 QSharedPointer<SharedUnityMenuModel> model1(createFullModel("test1"));
71 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
80 QSharedPointer<SharedUnityMenuModel> model2(createFullModel("test1"));
72
81