F:/KPlato/koffice/libs/kotext/tests/kovariabletest.cpp

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include <qtest_kde.h>
00020 
00021 #include <QString>
00022 #include <QObject>
00023 
00024 #include "kovariabletest.h"
00025 #include "../IsoDuration.h"
00026 
00027 QTEST_KDEMAIN( KoVariableTest, NoGUI )
00028 
00029 void KoVariableTest::testMinutes()
00030 {
00031     int minutes = 145;
00032     QString str = minutesToISODuration( minutes );
00033     int result = ISODurationToMinutes( str );
00034     qDebug( "%d minutes -> %s -> %d", minutes, qPrintable(str), result );
00035     QCOMPARE( result, minutes );
00036 }
00037 
00038 void KoVariableTest::testNegativeMinutes()
00039 {
00040     int minutes = -15;
00041     QString str = minutesToISODuration( minutes );
00042     int result = ISODurationToMinutes( str );
00043     qDebug( "%d minutes -> %s -> %d", minutes, qPrintable(str), result );
00044     QCOMPARE( result, minutes );
00045 }
00046 
00047 void KoVariableTest::testDays()
00048 {
00049     int days = 14;
00050     QString str = daysToISODuration( days );
00051     int result = ISODurationToDays( str );
00052     qDebug( "%d days -> %s -> %d", days, qPrintable(str), result );
00053     QCOMPARE( result, days );
00054 }
00055 
00056 void KoVariableTest::testNegativeDays()
00057 {
00058     int days = -14;
00059     QString str = daysToISODuration( days );
00060     int result = ISODurationToDays( str );
00061     qDebug( "%d days -> %s -> %d", days, qPrintable(str), result );
00062     QCOMPARE( result, days );
00063 }
00064 
00065 #include "kovariabletest.moc"

Généré le Wed Nov 22 23:41:11 2006 pour KPlato par  doxygen 1.5.1-p1