/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #include #include //int getSimilarityScore(const QString &str1, const char* str2); #include "../shared/simtexth.h" #include "tst_linguist.h" void tst_linguist::simtexth() { QFETCH(QString, one); QFETCH(QString, two); QFETCH(int, expected); int measured = getSimilarityScore(one, two.toLatin1()); QCOMPARE(measured, expected); } void tst_linguist::simtexth_data() { using namespace QTest; addColumn("one"); addColumn("two"); addColumn("expected"); newRow("00") << "" << "" << 1024; newRow("01") << "a" << "a" << 1024; newRow("02") << "ab" << "ab" << 1024; newRow("03") << "abc" << "abc" << 1024; newRow("04") << "abcd" << "abcd" << 1024; }