diff options
author | Florian Geyer <blueice@fobos.de> | 2013-03-25 00:21:06 +0400 |
---|---|---|
committer | Florian Geyer <blueice@fobos.de> | 2013-03-25 00:57:34 +0400 |
commit | 6ee781a6088a0dede19c54f5c6b2ac14acf2a3d3 (patch) | |
tree | b1fc27ff41a10e9665dac7bc69661a926f0e9747 /tests/TestEntry.cpp | |
parent | 97b488b2bad3f26014d9941cbd7e149b2b27fd91 (diff) |
Add regression test for issue #56.
Diffstat (limited to 'tests/TestEntry.cpp')
-rw-r--r-- | tests/TestEntry.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/TestEntry.cpp b/tests/TestEntry.cpp new file mode 100644 index 000000000..49f5d65a7 --- /dev/null +++ b/tests/TestEntry.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 Felix Geyer <debfx@fobos.de> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 or (at your option) + * version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "TestEntry.h" + +#include <QtTest/QTest> + +#include "tests.h" +#include "core/Entry.h" + +void TestEntry::testHistoryItemDeletion() +{ + Entry* entry = new Entry(); + Entry* historyEntry = new Entry(); + + entry->addHistoryItem(historyEntry); + QCOMPARE(entry->historyItems().size(), 1); + + QList<Entry*> historyEntriesToRemove; + historyEntriesToRemove.append(historyEntry); + entry->removeHistoryItems(historyEntriesToRemove); + QCOMPARE(entry->historyItems().size(), 0); +} + +QTEST_GUILESS_MAIN(TestEntry) |