Changeset View
Changeset View
Standalone View
Standalone View
language/codegen/tests/test_templatesmodel.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
63 | 63 | | |||
64 | void TestTemplatesModel::descriptionParsing() | 64 | void TestTemplatesModel::descriptionParsing() | ||
65 | { | 65 | { | ||
66 | QList<QStandardItem*> items = model->findItems(QStringLiteral("Testing YAML template"), Qt::MatchRecursive); | 66 | QList<QStandardItem*> items = model->findItems(QStringLiteral("Testing YAML template"), Qt::MatchRecursive); | ||
67 | QCOMPARE(items.size(), 1); | 67 | QCOMPARE(items.size(), 1); | ||
68 | QStandardItem* item = items.first(); | 68 | QStandardItem* item = items.first(); | ||
69 | 69 | | |||
70 | QCOMPARE(item->data(TemplatesModel::CommentRole).toString(), QStringLiteral("Describes a class using YAML syntax")); | 70 | QCOMPARE(item->data(TemplatesModel::CommentRole).toString(), QStringLiteral("Describes a class using YAML syntax")); | ||
71 | QVERIFY(item->data(TemplatesModel::IconNameRole).toString().isEmpty()); | | |||
72 | 71 | | |||
73 | QString descriptionFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kdevcodegentest/template_descriptions/test_yaml.desktop"; | 72 | QString descriptionFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kdevcodegentest/template_descriptions/test_yaml.desktop"; | ||
74 | 73 | | |||
75 | QVERIFY(QFile::exists(descriptionFile)); | 74 | QVERIFY(QFile::exists(descriptionFile)); | ||
76 | QCOMPARE(item->data(TemplatesModel::DescriptionFileRole).toString(), descriptionFile); | 75 | QCOMPARE(item->data(TemplatesModel::DescriptionFileRole).toString(), descriptionFile); | ||
77 | } | 76 | } | ||
78 | 77 | | |||
79 | void TestTemplatesModel::templateIndexes() | 78 | void TestTemplatesModel::templateIndexes() | ||
Show All 11 Lines |