Fix template syntax for test case generation

This was broken by astyle in commit v4.95.0~5 (Code reformatted using
kde-dev-scripts/astyle-kdelibs. Use git blame -w 5d4c2df to show
authorship as it was before this commit., 2013-12-18), because despite
the filenames, this is not really c++ code.
wilder
Stephen Kelly 10 years ago
parent bb1eb0fa10
commit 0609bafdef
  1. 4
      autotests/proxymodeltestsuite/templates/datachanged.cpp
  2. 11
      autotests/proxymodeltestsuite/templates/init.cpp
  3. 20
      autotests/proxymodeltestsuite/templates/layoutchanged.cpp
  4. 49
      autotests/proxymodeltestsuite/templates/main.cpp
  5. 6
      autotests/proxymodeltestsuite/templates/modelreset.cpp
  6. 14
      autotests/proxymodeltestsuite/templates/rowsinserted.cpp
  7. 4
      autotests/proxymodeltestsuite/templates/rowsremoved.cpp

@ -1,8 +1,8 @@
{
{
ModelDataChangeCommand dataChangeCommand(&rootModel);
dataChangeCommand.setAncestorRowNumbers({{ event.rowAncestors }});
dataChangeCommand.setStartRow({{ event.start }});
dataChangeCommand.setEndRow({{ event.end }});
dataChangeCommand.doCommand();
}
}

@ -1,10 +1,11 @@
{ % if event.interpretString % } {
ModelInsertCommand insertCommand(&rootModel);
{% if event.interpretString %}
{
ModelInsertCommand insertCommand(&rootModel);
insertCommand.setStartRow(0);
insertCommand.interpret(
{{ event.interpretString }}
{{ event.interpretString }}
);
insertCommand.doCommand();
}
{ % endif % }
}
{% endif %}

@ -1,18 +1,18 @@
{
{
ModelLayoutChangeCommand layoutChangeCommand(&rootModel);
layoutChangeCommand.setInitialTree(
{{ event.interpretString }}
{{ event.interpretString }}
);
QList<ModelLayoutChangeCommand::PersistentChange> changes;
{ % for change in event.changes % }
{
ModelLayoutChangeCommand::PersistentChange change;
change.oldPath = {{ change.oldPath }};
change.newPath = {{ change.newPath }};
changes.append(change);
{% for change in event.changes %}
{
ModelLayoutChangeCommand::PersistentChange change;
change.oldPath = {{ change.oldPath }};
change.newPath = {{ change.newPath }};
changes.append(change);
}
{ % endfor % }
{% endfor %}
layoutChangeCommand.setPersistentChanges(changes);
layoutChangeCommand.doCommand();
}
}

@ -2,42 +2,27 @@
#include <QApplication>
#include <dynamictreemodel.h>
int main(int argc, char **argv)
int main (int argc, char **argv)
{
QApplication app(argc, argv);
QApplication app(argc, argv);
DynamicTreeModel rootModel;
{
% if initEvent %
} {
% with initEvent as event %
}
// Include {{ "init.cpp" }}: {% include "init.cpp" %}
{
% endwith %
} {
% endif %
}
DynamicTreeModel rootModel;
{% if initEvent %} {% with initEvent as event %}
// Include {{ "init.cpp" }}: {% include "init.cpp" %}
{% endwith %} {% endif %}
// Create and connect the proxy model here.
// eg:
// Create and connect the proxy model here.
// eg:
// QSortFilterProxyModel proxy;
// proxy.setDynamicSortFilter(true);
// proxy.setSourceModel(&rootModel);
// QSortFilterProxyModel proxy;
// proxy.setDynamicSortFilter(true);
// proxy.setSourceModel(&rootModel);
// Have {{ events|length }} Events.
{% for event in events %} {% with event.type|lower|stringformat:"%1.cpp" as eventtemplate %}
// Include {{ eventtemplate }}: {% include eventtemplate %}
{% endwith %} {% endfor %}
// Have {{ events|length }} Events.
{
% for event in events %
} {
% with event.type | lower | stringformat: "%1.cpp" as eventtemplate %
}
// Include {{ eventtemplate }}: {% include eventtemplate %}
{
% endwith %
} {
% endfor %
}
return app.exec();
return app.exec();
}

@ -1,8 +1,8 @@
{
{
ModelResetCommand resetCommand(&rootModel);
resetCommand.setInitialTree(
{{ event.interpretString }}
{{ event.interpretString }}
);
resetCommand.doCommand();
}
}

@ -1,14 +1,14 @@
{
{
ModelInsertCommand insertCommand(&rootModel);
insertCommand.setAncestorRowNumbers({{ event.rowAncestors }});
insertCommand.setStartRow({{ event.start }});
{ % if event.interpretString % }
insertCommand.interpret(
{% if event.interpretString %}
insertCommand.interpret(
{{ event.interpretString }}
);
{ % else % }
);
{% else %}
insertCommand.setEnd({{ event.end }});
{ % endif % }
{% endif %}
insertCommand.doCommand();
}
}

@ -1,8 +1,8 @@
{
{
ModelRemoveCommand removeCommand(&rootModel);
removeCommand.setAncestorRowNumbers({{ event.rowAncestors }});
removeCommand.setStartRow({{ event.start }});
removeCommand.setEndRow({{ event.end }});
removeCommand.doCommand();
}
}

Loading…
Cancel
Save