~ubuntu-branches/ubuntu/saucy/rocs/saucy-proposed

« back to all changes in this revision

Viewing changes to RocsCore/LoadSave/Plugins/dotFileFormat/Tests/DotFileFormatTest.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-06-21 02:04:20 UTC
  • mfrom: (1.1.27)
  • Revision ID: package-import@ubuntu.com-20130621020420-lzlui9y7qc6w3xog
Tags: 4:4.10.80-0ubuntu1
[ Rohan Garg ]
* New upstream release

[ Philip Muškovac ]
* Build-depend on libgrantlee-dev and libx11-dev
* Update rocs.install and not-installed 

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
void DotFileFormatTest::checkNodes(DataStructurePtr dataStructure, QList<QString> nodeNames)
47
47
{
48
 
    QList<DataPtr> dataList = dataStructure->dataList();
 
48
    QList<DataPtr> dataList = dataStructure->dataList(0);
49
49
 
50
50
//     foreach(const DataPtr &node, dataList) {
51
51
//         kDebug() << node->property("name").toString();
66
66
void DotFileFormatTest::init()
67
67
{
68
68
    // test for graph data structure plugin
69
 
    if (DataStructureBackendManager::self()->backends().count() == 0) {
 
69
    if (DataStructureBackendManager::self().backends().count() == 0) {
70
70
        QFAIL("No plugin of DS, no way to continue!");
71
71
    }
72
 
    DataStructurePluginInterface *pl = DataStructureBackendManager::self()->backend("Graph");
 
72
    DataStructureBackendInterface *pl = DataStructureBackendManager::self().backend("Graph");
73
73
    QVERIFY2(pl,"Could create data structure of type Graph");
74
74
}
75
75
 
84
84
    }
85
85
 
86
86
    DataStructurePtr graph = doc.dataStructures().at(0);
87
 
    QVERIFY(graph->dataList().count() == 5);
88
 
    QVERIFY(graph->pointers().count() == 2);
 
87
    QVERIFY(graph->dataList(0).count() == 5);
 
88
    QVERIFY(graph->pointers(0).count() == 2);
89
89
}
90
90
 
91
91
 
112
112
    checkNodes(dataStructure, nodeNames);
113
113
 
114
114
    // Check the numbers of pointers
115
 
    QVERIFY(dataStructure->pointers().count() == 12);
 
115
    QVERIFY(dataStructure->pointers(0).count() == 12);
116
116
 
117
117
    // Check that a pointer has the correct label & that the node labels work.
118
 
    QList<DataPtr> dataList = dataStructure->dataList();
 
118
    QList<DataPtr> dataList = dataStructure->dataList(0);
119
119
    DataPtr start;
120
120
    DataPtr end;
121
121
    foreach(const DataPtr &node, dataList) {
179
179
    nodeNames << "run" << "intr" << "runbl" << "kernel" << "zombie" << "sleep" << "swap" << "runmem" << "runswap" << "new";
180
180
    checkNodes(dataStructure, nodeNames);
181
181
    // Check the numbers of pointers
182
 
    QVERIFY(dataStructure->pointers().count() == 13);
 
182
    QVERIFY(dataStructure->pointers(0).count() == 13);
183
183
}
184
184
 
185
185
 
340
340
    checkNodes(dataStructure, nodeNames);
341
341
 
342
342
    // Check the numbers of pointers
343
 
    QVERIFY(dataStructure->pointers().count() == 14);
 
343
    QVERIFY(dataStructure->pointers(0).count() == 14);
344
344
 
345
345
    // Check that a pointer has the correct label and that the shapes are correct.
346
 
    QList<DataPtr> dataList = dataStructure->dataList();
 
346
    QList<DataPtr> dataList = dataStructure->dataList(0);
347
347
    QVERIFY(dataList.length() == 9); // Make the test quit because the parser has too many LR nodes.
348
348
    DataPtr start;
349
349
    DataPtr end;
740
740
    checkNodes(dataStructure, nodeNames);
741
741
 
742
742
    // check number of pointers
743
 
    QVERIFY(dataStructure->pointers().count() == 49);
 
743
    QVERIFY(dataStructure->pointers(0).count() == 49);
744
744
}
745
745
 
746
746