diff options
-rw-r--r-- | tests/hawd/formatter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/hawd/formatter.cpp b/tests/hawd/formatter.cpp index 6d1f6de..4221b03 100644 --- a/tests/hawd/formatter.cpp +++ b/tests/hawd/formatter.cpp | |||
@@ -42,10 +42,15 @@ void Formatter::print(const QString &datasetName, const QStringList &cols, State | |||
42 | void Formatter::print(Dataset &dataset, const QStringList &cols) | 42 | void Formatter::print(Dataset &dataset, const QStringList &cols) |
43 | { | 43 | { |
44 | std::cout << dataset.tableHeaders(cols).toStdString() << std::endl; | 44 | std::cout << dataset.tableHeaders(cols).toStdString() << std::endl; |
45 | //Just reading doesn't sort the rows, let's use a map | ||
46 | QMap<qint64, QString> rows; | ||
45 | dataset.eachRow( | 47 | dataset.eachRow( |
46 | [cols](const Dataset::Row &row) { | 48 | [cols, &rows](const Dataset::Row &row) { |
47 | std::cout << row.toString(cols).toStdString() << std::endl; | 49 | rows.insert(row.key(), row.toString()); |
48 | }); | 50 | }); |
51 | for (const auto &s : rows.values().mid(rows.size() - 10)) { | ||
52 | std::cout << s.toStdString() << std::endl; | ||
53 | } | ||
49 | } | 54 | } |
50 | 55 | ||
51 | } | 56 | } |