diff --git a/kcal/CMakeLists.txt b/kcal/CMakeLists.txt index 519af6802..e9a325a90 100644 --- a/kcal/CMakeLists.txt +++ b/kcal/CMakeLists.txt @@ -1,181 +1,184 @@ project(kcal) macro_optional_find_package(Libical) macro_log_feature(LIBICAL_FOUND "libical" "Reference implementation of the iCalendar data type and serialization format" "http://sourceforge.net/projects/freeassociation" TRUE "0.33" "Required for the critical PIM kcal library.") if(NOT LIBICAL_FOUND) macro_display_feature_log() endif(NOT LIBICAL_FOUND) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5800) include (ConfigureChecks.cmake) if(KDE4_BUILD_TESTS) add_definitions(-DCOMPILING_TESTS) endif(KDE4_BUILD_TESTS) include_directories( ${LIBICAL_INCLUDE_DIRS} ${LIBICAL_INCLUDE_DIRS}/libical ${CMAKE_CURRENT_SOURCE_DIR}/versit ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/kabc ${CMAKE_BINARY_DIR}/kabc ${KDE4_INCLUDE_DIR} ) -set(libversit_SRCS - ${CMAKE_SOURCE_DIR}/kcal/versit/vcc.c - ${CMAKE_SOURCE_DIR}/kcal/versit/vobject.c +set(libversit_SRCS + ${CMAKE_SOURCE_DIR}/kcal/versit/vcc.c + ${CMAKE_SOURCE_DIR}/kcal/versit/vobject.c ) ########### next target ############### set(kcal_LIB_SRCS ${libversit_SRCS} incidencebase.cpp incidence.cpp journal.cpp todo.cpp event.cpp freebusy.cpp freebusyperiod.cpp attendee.cpp attachment.cpp recurrencerule.cpp recurrence.cpp alarm.cpp customproperties.cpp calendar.cpp calendarlocal.cpp calformat.cpp vcalformat.cpp icalformat.cpp icalformat_p.cpp incidenceformatter.cpp vcaldrag.cpp icaldrag.cpp exceptions.cpp scheduler.cpp imipscheduler.cpp dummyscheduler.cpp calfilter.cpp person.cpp period.cpp duration.cpp dndfactory.cpp calstorage.cpp filestorage.cpp compat.cpp resourcecalendar.cpp resourcelocal.cpp resourcelocalconfig.cpp resourcelocaldir.cpp resourcelocaldirconfig.cpp resourcecached.cpp resourcecachedconfig.cpp calendarresources.cpp qtopiaformat.cpp htmlexport.cpp calendarnull.cpp freebusyurlstore.cpp confirmsavedialog.cpp icaltimezones.cpp - kresult.cpp ) + kresult.cpp + assignmentvisitor.cpp +) kde4_add_kcfg_files(kcal_LIB_SRCS htmlexportsettings.kcfgc ) kde4_add_library(kcal SHARED ${kcal_LIB_SRCS}) target_link_libraries(kcal ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QT_QTXML_LIBRARY} kresources kabc kpimutils ${LIBICAL_LIBRARIES}) target_link_libraries(kcal LINK_INTERFACE_LIBRARIES kresources kabc) set_target_properties(kcal PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) install(TARGETS kcal EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### next target ############### set(kcal_local_PART_SRCS resourcelocal_plugin.cpp ) kde4_add_plugin(kcal_local ${kcal_local_PART_SRCS}) target_link_libraries(kcal_local ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kcal kresources ) install(TARGETS kcal_local DESTINATION ${PLUGIN_INSTALL_DIR}) ########### next target ############### set(kcal_localdir_PART_SRCS resourcelocaldir_plugin.cpp ) kde4_add_plugin(kcal_localdir ${kcal_localdir_PART_SRCS}) target_link_libraries(kcal_localdir ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kcal kresources) install(TARGETS kcal_localdir DESTINATION ${PLUGIN_INSTALL_DIR}) add_subdirectory( tests ) ########### install files ############### install( FILES local.desktop localdir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresources/kcal) install( FILES alarm.h + assignmentvisitor.h attachment.h attendee.h calendar.h calendarlocal.h calendarnull.h calendarresources.h calfilter.h calformat.h calstorage.h confirmsavedialog.h customproperties.h dndfactory.h duration.h event.h exceptions.h filestorage.h freebusy.h freebusycache.h freebusyperiod.h freebusyurlstore.h ${CMAKE_CURRENT_BINARY_DIR}/htmlexportsettings.h htmlexport.h icaldrag.h icalformat.h icaltimezones.h imipscheduler.h incidencebase.h incidence.h incidenceformatter.h journal.h kcal_export.h kcalversion.h listbase.h period.h person.h qtopiaformat.h recurrencerule.h recurrence.h resourcecached.h resourcecachedconfig.h resourcecalendar.h resourcelocalconfig.h resourcelocaldirconfig.h resourcelocaldir.h resourcelocal.h scheduler.h sortablelist.h todo.h vcaldrag.h vcalformat.h kresult.h DESTINATION ${INCLUDE_INSTALL_DIR}/kcal COMPONENT Devel) install( FILES kcal_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresources) diff --git a/kcal/assignmentvisitor.cpp b/kcal/assignmentvisitor.cpp new file mode 100644 index 000000000..2ac873b75 --- /dev/null +++ b/kcal/assignmentvisitor.cpp @@ -0,0 +1,123 @@ +/* + Copyright (c) 2009 Kevin Krammer + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#include "assignmentvisitor.h" + +#include "event.h" +#include "freebusy.h" +#include "journal.h" +#include "todo.h" + +#include + +using namespace KCal; + +class AssignmentVisitor::Private +{ + public: + Private() : mSource( 0 ) {} + + public: + const IncidenceBase *mSource; +}; + +AssignmentVisitor::AssignmentVisitor() : d( new Private() ) +{ +} + +AssignmentVisitor::~AssignmentVisitor() +{ + delete d; +} + +bool AssignmentVisitor::assign( IncidenceBase *target, const IncidenceBase *source ) +{ + Q_ASSERT( target != 0 ); + Q_ASSERT( source != 0 ); + + d->mSource = source; + + bool result = target->accept( *this ); + + d->mSource = 0; + + return result; +} + +bool AssignmentVisitor::visit( Event *event ) +{ + Q_ASSERT( event != 0 ); + + const Event *source = dynamic_cast( d->mSource ); + if ( source == 0 ) { + kError(5800) << "Type mismatch: source is" << d->mSource->type() + << "target is" << event->type(); + return false; + } + + *event = *source; + return true; +} + +bool AssignmentVisitor::visit( Todo *todo ) +{ + Q_ASSERT( todo != 0 ); + + const Todo *source = dynamic_cast( d->mSource ); + if ( source == 0 ) { + kError(5800) << "Type mismatch: source is" << d->mSource->type() + << "target is" << todo->type(); + return false; + } + + *todo = *source; + return true; +} + +bool AssignmentVisitor::visit( Journal *journal ) +{ + Q_ASSERT( journal != 0 ); + + const Journal *source = dynamic_cast( d->mSource ); + if ( source == 0 ) { + kError(5800) << "Type mismatch: source is" << d->mSource->type() + << "target is" << journal->type(); + return false; + } + + *journal = *source; + return true; +} + +bool AssignmentVisitor::visit( FreeBusy *freebusy ) +{ + Q_ASSERT( freebusy != 0 ); + + const FreeBusy *source = dynamic_cast( d->mSource ); + if ( source == 0 ) { + kError(5800) << "Type mismatch: source is" << d->mSource->type() + << "target is" << freebusy->type(); + return false; + } + + *freebusy = *source; + return true; +} + +// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kcal/assignmentvisitor.h b/kcal/assignmentvisitor.h new file mode 100644 index 000000000..2f235fab2 --- /dev/null +++ b/kcal/assignmentvisitor.h @@ -0,0 +1,117 @@ +/* + Copyright (c) 2009 Kevin Krammer + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library 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 Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#ifndef KCAL_ASSIGNMENTVISITOR_H +#define KCAL_ASSIGNMENTVISITOR_H + +#include "kcal_export.h" + +#include "incidencebase.h" + +namespace KCal { + +/** + Helper for type correct assignment of incidence pointers. + + Usage example: + @code + KCal::Incidence *currentIncidence; // assume this is set somewhere else + KCal::Incidence *updatedIncidence; // assume this is set somewhere else + + KCal::AssignmentVisitor visitor; + + // assign + if ( !visitor.assign(currentIncidence, updatedIncidence) ) { + // not of same type + } + @endcode + + @author Kevin Krammer \ + + @since 4.3 + */ +class KCAL_EXPORT AssignmentVisitor : public IncidenceBase::Visitor +{ + public: + /** + Creates a visitor instance. + */ + AssignmentVisitor(); + + /** + Destroys the instance + */ + virtual ~AssignmentVisitor(); + + /** + Assigns the @p source to the @p target + + Basically the sub type equivalent of + @code + *target = *source + @endcode + + @param target the instance to assign to + @param source the instance to assign from + + @return @c false if the two objects are of different type + */ + bool assign( IncidenceBase *target, const IncidenceBase *source ); + + /** + Tries to assign to the given @p event + + @return @c false if the source passed to assign() is of a different type + */ + virtual bool visit( Event *event ); + + /** + Tries to assign to the given @p todo + + @return @c false if the source passed to assign() is of a different type + */ + virtual bool visit( Todo *todo ); + + /** + Tries to assign to the given @p journal + + @return @c false if the source passed to assign() is of a different type + */ + virtual bool visit( Journal *journal ); + + /** + Tries to assign to the given @p freebusy^ + + @return @c false if the source passed to assign() is of a different type + */ + virtual bool visit( FreeBusy *freebusy ); + + private: + //@cond PRIVATE + class Private; + Private *const d; + //@endcond + + Q_DISABLE_COPY( AssignmentVisitor ) +}; + +} + +#endif +// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kcal/tests/CMakeLists.txt b/kcal/tests/CMakeLists.txt index 18ae2f7ce..679f6f2b1 100644 --- a/kcal/tests/CMakeLists.txt +++ b/kcal/tests/CMakeLists.txt @@ -1,119 +1,120 @@ set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) include_directories( ${CMAKE_SOURCE_DIR}/kcal ${LIBICAL_INCLUDE_DIRS} ) MACRO(KCAL_UNIT_TESTS) FOREACH(_testname ${ARGN}) kde4_add_unit_test(${_testname} NOGUI ${_testname}.cpp) target_link_libraries(${_testname} ${KDE4_KDECORE_LIBS} kcal ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY} ${LIBICAL_LIBRARIES}) ENDFOREACH(_testname) ENDMACRO(KCAL_UNIT_TESTS) MACRO(KCAL_EXECUTABLE_TESTS) FOREACH(_testname ${ARGN}) kde4_add_executable(${_testname} NOGUI TEST ${_testname}.cpp) target_link_libraries(${_testname} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} kcal ${QT_QTTEST_LIBRARY} kresources) ENDFOREACH(_testname) ENDMACRO(KCAL_EXECUTABLE_TESTS) KCAL_UNIT_TESTS( testalarm + testassignmentvisitor testattachment testattendee testcalendarlocal testcalendarnull # testcalendarresources disable for now because it cause akonadi to start testcalfilter testduration testerrorformat testevent testfilestorage testfreebusy testjournal testkresult testperiod testperson testsortablelist testtodo ) # this test cannot work with msvc because libical should not be altered # and therefore we can't add KCAL_EXPORT there # it should work fine with mingw because of the auto-import feature if(NOT MSVC) KCAL_UNIT_TESTS(testicaltimezones) endif(NOT MSVC) KCAL_EXECUTABLE_TESTS( convertqtopia incidencestest loadcalendar fbrecurring readandwrite testfb testrecurprevious testrecurrence testrecurrencetype testrecurson testresource testtostring testvcalexport ) ########### next target ############### set(testfields_SRCS testfields.cpp) set(srcfile "${CMAKE_SOURCE_DIR}/kcal/tests/data/test_pilot.ics") add_definitions( -D_TESTINPUT="\\"${srcfile}\\"" ) kde4_add_executable(testfields TEST ${testfields_SRCS}) target_link_libraries(testfields ${KDE4_KDECORE_LIBS} kcal ) ########### Tests ####################### FILE( GLOB_RECURSE testFiles data/RecurrenceRule/*.ics ) FILE( GLOB_RECURSE compatFiles data/Compat/*.ics ) FILE( GLOB_RECURSE vCalFilesAsIcal data/vCalendar/*.ics ) FILE( GLOB_RECURSE vCalFiles data/vCalendar/*.vcs ) FOREACH( file ${testFiles} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( RecurNext-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/testrecurrence.shell "next" ${file} ) ENDFOREACH(file) FOREACH( file ${testFiles} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( RecurPrev-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/testrecurprevious.shell "prev" ${file} ) ENDFOREACH(file) FOREACH( file ${testFiles} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( RecursOn-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/testrecurson.shell "recurson" ${file} ) ENDFOREACH(file) FOREACH( file ${compatFiles} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( Compat-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/readandwrite.shell "ical" ${file} ) ENDFOREACH(file) FOREACH( file ${vCalFilesAsIcal} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( VCalOut-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/testvcalexport.shell "vcal" ${file} ) ENDFOREACH(file) FOREACH( file ${vCalFiles} ) GET_FILENAME_COMPONENT( fn ${file} NAME) ADD_TEST( VCalIn-${fn} ${CMAKE_CURRENT_SOURCE_DIR}/runsingletestcase.pl ${EXECUTABLE_OUTPUT_PATH}/readandwrite.shell "ical" ${file} ) ENDFOREACH(file) # ADD_TEST( TestRecurrence runtestcase.pl testrecurrence "next" ${CMAKE_CURRENT_SOURCE_DIR} data/RecurrenceRule/ "*.ics" ) # ADD_TEST( TestRecPrevious runtestcase.pl testrecurprevious "prev" ${CMAKE_CURRENT_SOURCE_DIR} data/RecurrenceRule/ "*.ics" ) # ADD_TEST( TestRecursOn runtestcase.pl testrecurson "recurson" ${CMAKE_CURRENT_SOURCE_DIR} data/RecurrenceRule/ "*.ics" ) # ADD_TEST( TestCompat runtestcase.pl readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR} data/Compat/ "*.ics" ) # ADD_TEST( TestVCal runtestcase.pl testvcalexport "vcal" ${CMAKE_CURRENT_SOURCE_DIR} data/vCalendar/ "*.ics" ) # ADD_TEST( TestFromVCal runtestcase.pl readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR} data/vCalendar/ "*.vcs" ) diff --git a/kcal/tests/testassignmentvisitor.cpp b/kcal/tests/testassignmentvisitor.cpp new file mode 100644 index 000000000..a111f49f1 --- /dev/null +++ b/kcal/tests/testassignmentvisitor.cpp @@ -0,0 +1,265 @@ +/* + This file is part of libkcal. + Copyright (c) 2009 Kevin Krammer + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kcal/assignmentvisitor.h" + +#include "kcal/event.h" +#include "kcal/freebusy.h" +#include "kcal/journal.h" +#include "kcal/todo.h" + +#include + +#include + +using namespace KCal; + +class AssignmentVisitorTest : public QObject +{ + Q_OBJECT + + private: + AssignmentVisitor mAssigner; + + private Q_SLOTS: + void testEventAssignment(); + void testFreeBusyAssignment(); + void testJournalAssignment(); + void testTodoAssignment(); + void testTypeMismatches(); +}; + +QTEST_KDEMAIN( AssignmentVisitorTest, NoGUI ) + +void AssignmentVisitorTest::testEventAssignment() +{ + const QString summary = QLatin1String( "Testing assignment" ); + const QString desc = QLatin1String( "Testing AssignmentVisitor" ); + const KDateTime now = KDateTime::currentUtcDateTime(); + const KDateTime later = now.addSecs( 3600 ); + + Event source; + source.setSummary( summary ); + source.setDescription( desc ); + source.setDtStart( now ); + source.setDtEnd( later ); + + // check source + { + QCOMPARE( source.summary(), summary ); + QCOMPARE( source.description(), desc ); + QCOMPARE( source.dtStart(), now ); + QCOMPARE( source.dtEnd(), later ); + } + + Event target1; + target1 = source; + + // check direct assignment + { + QCOMPARE( source, target1 ); + + QCOMPARE( target1.summary(), summary ); + QCOMPARE( target1.description(), desc ); + QCOMPARE( target1.dtStart(), now ); + QCOMPARE( target1.dtEnd(), later ); + } + + Event target2; + + IncidenceBase *baseSource = &source; + IncidenceBase *baseTarget = &target2; + + bool result = mAssigner.assign( baseTarget, baseSource ); + QVERIFY( result ); + + // check indirect assignment + { + QCOMPARE( source, target2 ); + + QCOMPARE( target2.summary(), summary ); + QCOMPARE( target2.description(), desc ); + QCOMPARE( target2.dtStart(), now ); + QCOMPARE( target2.dtEnd(), later ); + } +} + +void AssignmentVisitorTest::testFreeBusyAssignment() +{ + const KDateTime now = KDateTime::currentUtcDateTime(); + const KDateTime later = now.addSecs( 3600 ); + + FreeBusy source; + source.setDtStart( now ); + source.setDtEnd( later ); + + // check source + { + QCOMPARE( source.dtStart(), now ); + QCOMPARE( source.dtEnd(), later ); + } + + FreeBusy target1; + target1 = source; + + // check direct assignment + { + QCOMPARE( source, target1 ); + + QCOMPARE( target1.dtStart(), now ); + QCOMPARE( target1.dtEnd(), later ); + } + + FreeBusy target2; + + IncidenceBase *baseSource = &source; + IncidenceBase *baseTarget = &target2; + + bool result = mAssigner.assign( baseTarget, baseSource ); + QVERIFY( result ); + + // check indirect assignment + { + QCOMPARE( source, target2 ); + + QCOMPARE( target2.dtStart(), now ); + QCOMPARE( target2.dtEnd(), later ); + } +} + +void AssignmentVisitorTest::testJournalAssignment() +{ + const QString summary = QLatin1String( "Testing assignment" ); + const QString desc = QLatin1String( "Testing AssignmentVisitor" ); + const KDateTime now = KDateTime::currentUtcDateTime(); + + Journal source; + source.setSummary( summary ); + source.setDescription( desc ); + source.setDtStart( now ); + + // check source + { + QCOMPARE( source.summary(), summary ); + QCOMPARE( source.description(), desc ); + QCOMPARE( source.dtStart(), now ); + } + + Journal target1; + target1 = source; + + // check direct assignment + { + QCOMPARE( source, target1 ); + + QCOMPARE( target1.summary(), summary ); + QCOMPARE( target1.description(), desc ); + QCOMPARE( target1.dtStart(), now ); + } + + Journal target2; + + IncidenceBase *baseSource = &source; + IncidenceBase *baseTarget = &target2; + + bool result = mAssigner.assign( baseTarget, baseSource ); + QVERIFY( result ); + + // check indirect assignment + { + QCOMPARE( source, target2 ); + + QCOMPARE( target2.summary(), summary ); + QCOMPARE( target2.description(), desc ); + QCOMPARE( target2.dtStart(), now ); + } +} + +void AssignmentVisitorTest::testTodoAssignment() +{ + const QString summary = QLatin1String( "Testing assignment" ); + const QString desc = QLatin1String( "Testing AssignmentVisitor" ); + + Todo source; + source.setSummary( summary ); + source.setDescription( desc ); + source.setPercentComplete( 50 ); + + // check source + { + QCOMPARE( source.summary(), summary ); + QCOMPARE( source.description(), desc ); + QCOMPARE( source.percentComplete(), 50 ); + } + + Todo target1; + target1 = source; + + // check direct assignment + { + QCOMPARE( source, target1 ); + + QCOMPARE( target1.summary(), summary ); + QCOMPARE( target1.description(), desc ); + QCOMPARE( target1.percentComplete(), 50 ); + } + + Todo target2; + + IncidenceBase *baseSource = &source; + IncidenceBase *baseTarget = &target2; + + bool result = mAssigner.assign( baseTarget, baseSource ); + QVERIFY( result ); + + // check indirect assignment + { + QCOMPARE( source, target2 ); + + QCOMPARE( target2.summary(), summary ); + QCOMPARE( target2.description(), desc ); + QCOMPARE( target2.percentComplete(), 50 ); + } +} + +void AssignmentVisitorTest::testTypeMismatches() +{ + Event event; + FreeBusy freeBusy; + Journal journal; + Todo todo; + + QList list; + list << &event << &freeBusy << &journal << &todo; + + for ( int i = 0; i < list.size(); ++i ) { + for ( int j = 0; j < list.size(); ++j ) { + bool result = mAssigner.assign( list[ i ], list[ j ] ); + if ( i == j ) + QVERIFY( result ); + else + QVERIFY( !result ); + } + } +} + +#include "kcalassignmenttest.moc" + +// kate: space-indent on; indent-width 2; replace-tabs on;