/* Copyright (C) 2008-2013 Børre Gaup This file is part of the program wordlist2hunspell. 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 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include #define private public // dirty trick to make private functions available for testing :D // place includes for classes that should be test below this line #include "../suffixmap.h" TEST(CheckAddition) { SuffixMap am; CHECK_EQUAL(1, am.addSuffix("test1\tNAIE,NePAE")); CHECK_EQUAL(2, am.addSuffix("test2\tNAIE,NePAE")); CHECK_EQUAL(1, am.addSuffix("test1\tNAIE,NePAE")); } TEST(CheckLookup) { SuffixMap am; am.addSuffix("test1\tNAIE,NePAE"); am.addSuffix("test2\tNAIE,NePAE"); CHECK_EQUAL("test1\tNAIE,NePAE", am.getSuffix(1)); CHECK_EQUAL("test2\tNAIE,NePAE", am.getSuffix(2)); }