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