-# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_COND_IF -*- Autoconf -*-
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# [AC_SUBST([GTEST], [" @echo \"Google Test was not found on the system. Unable to build tests.\""])])
#AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile tests/Makefile"
-#AC_CONFIG_FILES([Makefile tests/Makefile])
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
# [AC_SUBST([GTEST], [" @echo \"Google Test was not found on the system. Unable to build tests.\""])])
#AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
-AC_CONFIG_FILES([Makefile])
-#AC_CONFIG_FILES([Makefile tests/Makefile])
+AC_CONFIG_FILES([Makefile tests/Makefile])
AC_OUTPUT
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
+#include <gtest/gtest.h>
+
+class CalendarDataStorageTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
Colour defaultColour;
-TEST(CalendarDataStorage, Setup_Tables){
+TEST_F(CalendarDataStorageTests, Setup_Tables){
CalendarDataStorage setupTablesTest;
}
-TEST(CalendarDataStorage, Add_One_Account){
+TEST_F(CalendarDataStorageTests, Add_One_Account){
CalendarDataStorage addOneEntryTest;
}
-TEST(CalendarDataStorage, Add_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Accounts){
CalendarDataStorage addTwoEntryTest;
}
-TEST(CalendarDataStorage, Add_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Accounts){
CalendarDataStorage addThreeEntryTest;
}
-TEST(CalendarDataStorage, Add_Account_With_No_Name_And_Return_No_Name_Message){
+TEST_F(CalendarDataStorageTests, Add_Account_With_No_Name_And_Return_No_Name_Message){
CalendarDataStorage failNameTest;
}
-TEST(CalendarDataStorage, Add_Account_With_Same_Name_Twice_And_Return_Failed_Message){
+TEST_F(CalendarDataStorageTests, Add_Account_With_Same_Name_Twice_And_Return_Failed_Message){
CalendarDataStorage duplicateNameTest;
}
-TEST(CalendarDataStorage, Get_Account_Information){
+TEST_F(CalendarDataStorageTests, Get_Account_Information){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Get_Account_Information_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Get_Account_Information_That_Does_Not_Exist_Return_No_Account_Message){
CalendarDataStorage noAccountTest;
}
-TEST(CalendarDataStorage, Get_Two_Accounts_Information){
+TEST_F(CalendarDataStorageTests, Get_Two_Accounts_Information){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Get_Three_Accounts_Information){
+TEST_F(CalendarDataStorageTests, Get_Three_Accounts_Information){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Get_List_Of_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_One_Account){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Two_Accounts){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Three_Accounts){
CalendarDataStorage accountInformationTest;
}
-TEST(CalendarDataStorage, Update_One_Account){
+TEST_F(CalendarDataStorageTests, Update_One_Account){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_No_Name_Return_No_Name_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_Set_Account_Name_To_No_Name_Return_No_Name_Message){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_Existing_Account_Return_Failed_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_Set_Account_Name_To_Existing_Account_Return_Failed_Message){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Update_One_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_That_Does_Not_Exist_Return_No_Account_Message){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Update_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Accounts){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Update_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Accounts){
CalendarDataStorage updateAccountTest;
}
-TEST(CalendarDataStorage, Delete_One_Account){
+TEST_F(CalendarDataStorageTests, Delete_One_Account){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Delete_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Delete_Two_Accounts){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Delete_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Delete_Three_Accounts){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Delete_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Delete_Account_That_Does_Not_Exist_Return_No_Account_Message){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_One_Account){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_One_Account){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_One_Account){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Calendar_To_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Add_Calendar_To_Account_That_Does_Not_Exist_Return_No_Account_Message){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_Two_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_Two_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_Two_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_Three_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_Three_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_Three_Accounts){
CalendarDataStorage addCalendarTest;
}
-TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_One_Account){
CalendarDataStorage getCalendarTest;
}
-TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_Two_Accounts){
CalendarDataStorage getCalendarTest;
}
-TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_Three_Accounts){
CalendarDataStorage getCalendarTest;
}
-TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_One_Account){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_Two_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_Three_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_One_Account){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_Two_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_Three_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_One_Account){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_Two_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_Three_Accounts){
CalendarDataStorage updateCalendarTest;
}
-TEST(CalendarDataStorage, Delete_One_Calendar){
+TEST_F(CalendarDataStorageTests, Delete_One_Calendar){
CalendarDataStorage deleteCalendarTest;
int calendarID = 0;
}
-TEST(CalendarDataStorage, Delete_Two_Calendars){
+TEST_F(CalendarDataStorageTests, Delete_Two_Calendars){
CalendarDataStorage deleteCalendarTest;
int calendarID1 = 0;
}
-TEST(CalendarDataStorage, Delete_Three_Calendars){
+TEST_F(CalendarDataStorageTests, Delete_Three_Calendars){
CalendarDataStorage deleteCalendarTest;
int calendarID1 = 0;
}
-TEST(CalendarDataStorage, Add_One_Event){
+TEST_F(CalendarDataStorageTests, Add_One_Event){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_Two_Events){
+TEST_F(CalendarDataStorageTests, Add_Two_Events){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_Three_Events){
+TEST_F(CalendarDataStorageTests, Add_Three_Events){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){
+TEST_F(CalendarDataStorageTests, Add_One_Event_And_Get_Event_Basic_Information){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Duration){
+TEST_F(CalendarDataStorageTests, Add_One_Event_And_Get_Event_Basic_Information_With_Duration){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){
+TEST_F(CalendarDataStorageTests, Add_Two_Events_And_Get_Event_Basic_Information){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){
+TEST_F(CalendarDataStorageTests, Add_The_Same_Three_Events_And_Get_Event_Information){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){
+TEST_F(CalendarDataStorageTests, Add_Three_Events_And_Get_Event_Information){
CalendarDataStorage addEventTest;
}
-TEST(CalendarDataStorage, Delete_One_Event){
+TEST_F(CalendarDataStorageTests, Delete_One_Event){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_Two_Events){
+TEST_F(CalendarDataStorageTests, Delete_Two_Events){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_Three_Events){
+TEST_F(CalendarDataStorageTests, Delete_Three_Events){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_One_Calendar_And_Events){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_Two_Calendars_And_Events){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_Three_Calendars_And_Events){
CalendarDataStorage deleteEventTest;
}
-TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_One_Account_And_Associated_Data){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_Two_Accounts_And_Associated_Data){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_Three_Accounts_And_Associated_Data){
CalendarDataStorage deleteAccountTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_One_Account){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_Two_Accounts){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_Three_Accounts){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_One_Account){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_Two_Accounts){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_Three_Accounts){
CalendarDataStorage getEventsListTest;
}
-TEST(CalendarDataStorage, Add_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Two_Checksus){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksus){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Three_Checksus){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksus){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_One_Checksum_And_Get_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum_And_Get_One_Checksum){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Two_Checksums_And_Get_Two_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksums_And_Get_Two_Checksums){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Three_Checksums_And_Get_Three_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksums_And_Get_Three_Checksums){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_One_Checksum_Update_One_Checksum_And_Get_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum_Update_One_Checksum_And_Get_One_Checksum){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Checksums){
CalendarDataStorage checksumTest;
}
-TEST(CalendarDataStorage, Add_Three_Checksums_Update_Three_Checksums_And_Get_Three_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksums_Update_Three_Checksums_And_Get_Three_Checksums){
CalendarDataStorage checksumTest;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
#include "../common/text.h"
#include "../common/colour.h"
#include "../common/monthviewgen.h"
-
-TEST(CommonFunctions, FileTests){
+#include <gtest/gtest.h>
+
+class CommonFunctionsTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(CommonFunctionsTests, FileTests){
ASSERT_EQ(false, FileExists("iCalendarEvent-Missing.vcf"));
ASSERT_EQ(true, FileExists("iCalendarEvent-InvalidPermissions.vcf"));
}
-TEST(CommonFunctions, ProcessTextVectorsTests){
+TEST_F(CommonFunctionsTests, ProcessTextVectorsTests){
// Setup the objects to be used for processing.
}
-TEST(CommonFunctions, SplitValuesTests){
+TEST_F(CommonFunctionsTests, SplitValuesTests){
map<string, string> textExample1TestResult;
}
-TEST(CommonFunctions, SplitNameValueTests){
+TEST_F(CommonFunctionsTests, SplitNameValueTests){
PropertyNameValue nameValueResult;
}
-TEST(CommonFunctions, HexToInt){
+TEST_F(CommonFunctionsTests, HexToInt){
string value1 = "10"; // 16
string value2 = "50"; // 80
}
-TEST(CommonFunctions, SplitPathFilename){
+TEST_F(CommonFunctionsTests, SplitPathFilename){
// Setup the file split.
}
-TEST(CommonFunctions, ColourStruct){
+TEST_F(CommonFunctionsTests, ColourStruct){
Colour colour1;
Colour colour2;
ASSERT_EQ(32, colour8.alpha);
}
-TEST(CommonFunctions, OutputText){
+TEST_F(CommonFunctionsTests, OutputText){
string inputText1 = "This is an example text.";
string outputText1 = "This is an example text.";
}
-TEST(CommonFunctions, PreviousMonthNumberofDays){
+TEST_F(CommonFunctionsTests, PreviousMonthNumberofDays){
// Test the year 2015 (does not have a leap year).
}
-TEST(CommonFunctions, monthViewGenerator){
+TEST_F(CommonFunctionsTests, monthViewGenerator){
XCCalendarMonthViewGrid monthView = GenerateMonthGrid(6, 2016);
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
--- /dev/null
+CPP=g++
+STRIP=strip
+CPPFLAGS=`xml2-config --cflags` `wx-config --cxxflags` -I.. -I../objects -std=c++11 -pthread -DXESTIACAL_UNITTEST -ggdb -O0 -g --coverage -fprofile-arcs -ftest-coverage
+CPPLIBS=`wx-config --libs` `curl-config --libs` -lsfml-audio -lxml2 -lgtest -coverage -lsqlite3
+MAKE=make
+OBJDIR=.
+
+ICALEVENTTESTS_OUT=xestiacalendar_icaleventtests
+ICALJOURNALTESTS_OUT=xestiacalendar_icaleventtests
+ICALTASKTESTS_OUT=xestiacalendar_icaltasktests
+ICALFREEBUSYTESTS_OUT=xestiacalendar_icalfreebusytests
+ICALTIMEZONETESTS_OUT=xestiacalendar_icaltimezonetests
+COMMONFUNCTIONSTESTS_OUT=xestiacalendar_commonfunctionstests
+CALENDARDATASTORAGETESTS_OUT=xestiacalendar_calendardatastoragetests
+
+ICALEVENTTESTS_OBJS=iCalendarEventTests/iCalendarEventLoad.cpp \
+ iCalendarEventTests/iCalendarEventSave.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendarevent/CalendarEvent.cpp \
+ ../objects/calendarevent/CalendarEvent-Save.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ iCalendarEventTests/main.cpp
+
+ICALJOURNALTESTS_OBJS=iCalendarJournalTests/iCalendarJournalLoad.cpp \
+ iCalendarJournalTests/iCalendarJournalSave.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendarjournal/CalendarJournal.cpp \
+ ../objects/calendarjournal/CalendarJournal-Save.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ iCalendarJournalTests/main.cpp
+
+ICALTASKTESTS_OBJS=iCalendarTaskTests/iCalendarTaskLoad.cpp \
+ iCalendarTaskTests/iCalendarTaskSave.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendartask/CalendarTask.cpp \
+ ../objects/calendartask/CalendarTask-Save.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ iCalendarTaskTests/main.cpp
+
+ICALFREEBUSYTESTS_OBJS=iCalendarFreeBusyTests/iCalendarFreeBusyLoad.cpp \
+ iCalendarFreeBusyTests/iCalendarFreeBusySave.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendarfreebusy/CalendarFreeBusy.cpp \
+ ../objects/calendarfreebusy/CalendarFreeBusy-Save.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ iCalendarFreeBusyTests/main.cpp
+
+ICALTIMEZONETESTS_OBJS=iCalendarTimeZoneTests/iCalendarTimeZoneLoad.cpp \
+ iCalendarTimeZoneTests/iCalendarTimeZoneSave.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendartimezone/CalendarTimezone.cpp \
+ ../objects/calendartimezone/CalendarTimezone-Save.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ iCalendarTimeZoneTests/main.cpp
+
+COMMONFUNCTIONSTESTS_OBJS=CommonFunctionsTests/CommonFunctionsTests.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ ../common/monthviewgen.cpp \
+ CommonFunctionsTests/main.cpp
+
+CALENDARDATASTORAGETESTS_OBJS=CalendarDataStorageTests/CalendarDataStorageTests.cpp \
+ ../libraries/CalendarDataStorage/CalendarDataStorage.cpp \
+ ../objects/calendarobject/CalendarObject.cpp \
+ ../objects/calendarobject/CalendarObject-Save.cpp \
+ ../objects/calendarevent/CalendarEvent.cpp \
+ ../objects/calendarevent/CalendarEvent-Save.cpp \
+ ../common/random.cpp \
+ ../common/file.cpp \
+ ../common/text.cpp \
+ CalendarDataStorageTests/main.cpp
+
+setupbrokenfiles:
+ chmod 000 iCalendarEvent-InvalidPermissions.vcf
+ chmod 000 iCalendarJournal-InvalidPermissions.vcf
+ chmod 000 iCalendarTask-InvalidPermissions.vcf
+ chmod 000 iCalendarFreeBusy-InvalidPermissions.vcf
+ chmod 000 iCalendarTimezone-InvalidPermissions.vcf
+
+resetbrokenfiles:
+ chmod 660 iCalendarEvent-InvalidPermissions.vcf
+ chmod 660 iCalendarJournal-InvalidPermissions.vcf
+ chmod 660 iCalendarTask-InvalidPermissions.vcf
+ chmod 660 iCalendarFreeBusy-InvalidPermissions.vcf
+ chmod 660 iCalendarTimezone-InvalidPermissions.vcf
+
+icaleventtests-objs: $(ICALEVENTTESTS_OBJS)
+
+icaleventtests-exec: icaleventtests-objs
+ $(CPP) $(CPPFLAGS) $(ICALEVENTTESTS_OBJS) -o $(ICALEVENTTESTS_OUT) $(CPPLIBS)
+
+icaleventtests-coverage: icaleventtests-exec
+ gcov iCalendarEventTests/*.cpp
+ ./$(ICALEVENTTESTS_OUT) --gtest_output=xml:icaleventtests.xml
+ lcov -c --directory . --output-file xestiacalendar_icaleventtests.info
+
+icaljournaltests-objs: $(ICALJOURNALTESTS_OBJS)
+
+icaljournaltests-exec: icaljournaltests-objs
+ $(CPP) $(CPPFLAGS) $(ICALJOURNALTESTS_OBJS) -o $(ICALJOURNALTESTS_OUT) $(CPPLIBS)
+
+icaljournaltests-coverage: icaljournaltests-exec
+ gcov iCalendarJournalTests/*.cpp
+ ./$(ICALJOURNALTESTS_OUT) --gtest_output=xml:icaljournaltests.xml
+ lcov -c --directory . --output-file xestiacalendar_icaljournaltests.info
+
+icaltasktests-objs: $(ICALTASKTESTS_OBJS)
+
+icaltasktests-exec: icaltasktests-objs
+ $(CPP) $(CPPFLAGS) $(ICALTASKTESTS_OBJS) -o $(ICALTASKTESTS_OUT) $(CPPLIBS)
+
+icaltasktests-coverage: icaltasktests-exec
+ gcov iCalendarTaskTests/*.cpp
+ ./$(ICALTASKTESTS_OUT) --gtest_output=xml:icaltasktests.xml
+ lcov -c --directory . --output-file xestiacalendar_icaltasktests.info
+
+icalfreebusytests-objs: $(ICALFREEBUSYTESTS_OBJS)
+
+icalfreebusytests-exec: icalfreebusytests-objs
+ $(CPP) $(CPPFLAGS) $(ICALFREEBUSYTESTS_OBJS) -o $(ICALFREEBUSYTESTS_OUT) $(CPPLIBS)
+
+icalfreebusytests-coverage: icalfreebusytests-exec
+ gcov iCalendarFreeBusyTests/*.cpp
+ ./$(ICALFREEBUSYTESTS_OUT) --gtest_output=xml:icalfreebusytests.xml
+ lcov -c --directory . --output-file xestiacalendar_icalfreebusytests.info
+
+icaltimezonetests-objs: $(ICALTIMEZONETESTS_OBJS)
+
+icaltimezonetests-exec: icaltimezonetests-objs
+ $(CPP) $(CPPFLAGS) $(ICALTIMEZONETESTS_OBJS) -o $(ICALTIMEZONETESTS_OUT) $(CPPLIBS)
+
+icaltimezonetests-coverage: icaltimezonetests-exec
+ gcov iCalendarTimeZoneTests/*.cpp
+ ./$(ICALTIMEZONETESTS_OUT) --gtest_output=xml:icaltimezonetests.xml
+ lcov -c --directory . --output-file xestiacalendar_icaltimezonetests.info
+
+commonfunctionstests-objs: $(COMMONFUNCTIONSTESTS_OBJS)
+
+commonfunctionstests-exec: commonfunctionstests-objs
+ $(CPP) $(CPPFLAGS) $(COMMONFUNCTIONSTESTS_OBJS) -o $(COMMONFUNCTIONSTESTS_OUT) $(CPPLIBS)
+
+commonfunctionstests-coverage: commonfunctionstests-exec
+ gcov CommonFunctionsTests/*.cpp
+ ./$(COMMONFUNCTIONSTESTS_OUT) --gtest_output=xml:commonfunctionstests.xml
+ lcov -c --directory . --output-file xestiacalendar_commonfunctionstests.info
+
+calendardatastoragetests-objs: $(CALENDARDATASTORAGETESTS_OBJS)
+
+calendardatastoragetests-exec: calendardatastoragetests-objs
+ $(CPP) $(CPPFLAGS) $(CALENDARDATASTORAGETESTS_OBJS) -o $(CALENDARDATASTORAGETESTS_OUT) $(CPPLIBS)
+
+calendardatastoragetests-coverage: calendardatastoragetests-exec
+ gcov iCalendarTimeZoneTests/*.cpp
+ ./$(CALENDARDATASTORAGETESTS_OUT) --gtest_output=xml:calendardatastoragetests.xml
+ lcov -c --directory . --output-file xestiacalendar_calendardatastoragetests.info
+
+clean: resetbrokenfiles
+ rm -rf *.gcda *.gcno *.xml *.info
+ rm -rf $(ICALEVENTTESTS_OUT) $(ICALJOURNALTESTS_OUT) $(ICALTASKTESTS_OUT) $(ICALFREEBUSYTESTS_OUT) $(ICALTIMEZONETESTS_OUT) $(COMMONFUNCTIONSTESTS_OUT) $(CALENDARDATASTORAGETESTS_OUT)
+ rm -rf Output report
+
+codecoverage: setupbrokenfiles icaleventtests-coverage icaljournaltests-coverage \
+ icaltasktests-coverage icalfreebusytests-coverage icaltimezonetests-coverage \
+ commonfunctionstests-coverage calendardatastoragetests-coverage
+ lcov -a xestiacalendar_icaleventtests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_icaljournaltests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_icaltasktests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_icalfreebusytests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_icaltimezonetests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_commonfunctionstests.info -o xestiacalendar_tests.info
+ lcov -a xestiacalendar_calendardatastoragetests.info -o xestiacalendar_tests.info
+ lcov -r xestiacalendar_tests.info '/usr/include/*' -o xestiacalendar_tests.info
+ lcov -r xestiacalendar_tests.info '*tests/*' -o xestiacalendar_tests.info
+ genhtml xestiacalendar_tests.info -output-directory report
+++ /dev/null
-#!/bin/sh
-
-g++ `wx-config --libs --cxxflags` -ggdb --std=c++11 \
-xestiacalendar_testxccalendarday.cpp \
-../widgets/XCCalendarDay.cpp \
-../widgets/XCCalendarDayEntry.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_testgui_xccalendarday
-
-g++ `wx-config --libs --cxxflags` -ggdb --std=c++11 \
-xestiacalendar_testxccalendarmonthview.cpp \
-../widgets/XCCalendarMonthView.cpp \
-../widgets/XCCalendarMonthViewDayTitle.cpp \
-../widgets/XCCalendarDay.cpp \
-../widgets/XCCalendarDayEntry.cpp \
-../common/monthviewgen.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_testgui_xccalendarmonthview
+++ /dev/null
-#!/bin/sh
-
-# Build the library first.
-
-g++ -ggdb --std=c++11 -c ../libraries/CalendarDataStorage/CalendarDataStorage.cpp \
- -o ../libraries/CalendarDataStorage/CalendarDataStorage-test.o \
- -lsqlite3
-ar rcs libCalendarDataStorage-test.a ../libraries/CalendarDataStorage/CalendarDataStorage-test.o
-
-echo "Building main unit test app..."
-
-# Build the unit testing application.
-
-g++ `xml2-config --cflags --libs` -ggdb --std=c++11 -lcurl -lgtest -pthread \
-xestiacalendar_test.cpp xestiacalendar_testcommon.cpp xestiacalendar_populate.cpp \
-../objects/calendarevent/CalendarEvent.cpp \
-../objects/calendarevent/CalendarEvent-Save.cpp \
-../objects/calendartask/CalendarTask.cpp \
-../objects/calendartask/CalendarTask-Save.cpp \
-../objects/calendarjournal/CalendarJournal.cpp \
-../objects/calendarjournal/CalendarJournal-Save.cpp \
-../objects/calendarfreebusy/CalendarFreeBusy.cpp \
-../objects/calendarfreebusy/CalendarFreeBusy-Save.cpp \
-../objects/calendartimezone/CalendarTimezone.cpp \
-../objects/calendartimezone/CalendarTimezone-Save.cpp \
-../objects/calendarobject/CalendarObject.cpp \
-../objects/calendarobject/CalendarObject-Save.cpp \
-../common/file.cpp \
-../common/text.cpp \
-../common/uuid.cpp \
-../common/monthviewgen.cpp \
-../common/random.cpp \
-../objects/CalDAV/CalDAV.cpp \
-../objects/CalDAV/CalDAV-XMLProcessing.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_test \
--L. -lCalendarDataStorage-test -lsqlite3
-// xestiacalendar_icaleventload.h - Xestia Calendar iCalendar Event Component Unit Tests
+// iCalendarEventLoad.cpp - Xestia Calendar iCalendar Event Component Unit Tests
//
-// (c) 2016-2017 Xestia Software Development.
+// (c) 2016-2019 Xestia Software Development.
//
// This file is part of Xestia Calendar.
//
// You should have received a copy of the GNU General Public License along
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-#include "../objects/calendarevent/CalendarEvent.h"
+#include "../../objects/calendarevent/CalendarEvent.h"
+#include <gtest/gtest.h>
-TEST(iCalendarEvent, BasicTests){
+class iCalendarEventLoadTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarEventLoadTests, BasicTests){
CalendarEventObject testEvent;
}
-TEST(iCalendarEvent, BaseObjectVerifyTests){
+TEST_F(iCalendarEventLoadTests, BaseObjectVerifyTests){
CalendarEventObject testEvent;
testEvent.LoadFile("iCalendarEvent-Load1.vcf");
}
-TEST(iCalendarEvent, ObjectDataTests){
+TEST_F(iCalendarEventLoadTests, ObjectDataTests){
CalendarEventObject testEvent;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
}
-TEST(iCalendarEvent, AlarmTests){
+TEST_F(iCalendarEventLoadTests, AlarmTests){
CalendarEventObject testEvent;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
-// xestiacalendar_icaleventsave.h - Xestia Calendar iCalendar Event Component Save Unit Tests
+// iCalendarEventSave.cpp - Xestia Calendar iCalendar Event Component Save Unit Tests
//
-// (c) 2016-2017 Xestia Software Development.
+// (c) 2016-2019 Xestia Software Development.
//
// This file is part of Xestia Calendar.
//
// You should have received a copy of the GNU General Public License along
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-#include "../objects/calendarevent/CalendarEvent.h"
+#include "../../objects/calendarevent/CalendarEvent.h"
+#include <gtest/gtest.h>
-TEST(iCalendarSaveEvent, SaveEventTests){
+class iCalendarEventSaveTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarEventSaveTests, SaveEventTests){
CalendarEventObject testEvent;
CalendarEventObject testEvent2;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendarfreebusy/CalendarFreeBusy.h"
+#include <gtest/gtest.h>
-TEST(iCalendarFreeBusy, BasicTests){
+class iCalendarFreeBusyLoadTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarFreeBusyLoadTests, BasicTests){
CalendarFreeBusyObject testFreeBusy;
}
-TEST(iCalendarFreeBusy, ObjectDataTests){
+TEST_F(iCalendarFreeBusyLoadTests, ObjectDataTests){
CalendarFreeBusyObject testFreeBusy;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy.LoadFile("iCalendarFreeBusy-Load2.vcf"));
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendarfreebusy/CalendarFreeBusy.h"
+#include <gtest/gtest.h>
-TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
+class iCalendarFreeBusySaveTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarFreeBusySaveTests, SaveFreeBusyTests){
CalendarFreeBusyObject testFreeBusy;
CalendarFreeBusyObject testFreeBusy2;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
// You should have received a copy of the GNU General Public License along
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-#include "../objects/calendarjournal/CalendarJournal.h"
-
-TEST(iCalendarJournal, BasicTests){
+#include "calendarjournal/CalendarJournal.h"
+#include <gtest/gtest.h>
+
+class iCalendarJournalLoadTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarJournalLoadTests, BasicTests){
CalendarJournalObject testJournal;
}
-TEST(iCalendarJournal, ObjectDataTests){
+TEST_F(iCalendarJournalLoadTests, ObjectDataTests){
CalendarJournalObject testJournal;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal.LoadFile("iCalendarJournal-Load2.vcf"));
// You should have received a copy of the GNU General Public License along
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-#include "../objects/calendarjournal/CalendarJournal.h"
+#include "calendarjournal/CalendarJournal.h"
+#include <gtest/gtest.h>
-TEST(iCalendarSaveJournal, SaveEventTests){
+class iCalendarJournalSaveTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarJournalSaveTests, SaveEventTests){
CalendarJournalObject testJournal;
CalendarJournalObject testJournal2;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendartask/CalendarTask.h"
-
-TEST(iCalendarTask, BasicTests){
+#include <gtest/gtest.h>
+
+class iCalendarTaskLoadTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarTaskLoadTests, BasicTests){
CalendarTaskObject testTask;
}
-TEST(iCalendarTask, ObjectDataTests){
+TEST_F(iCalendarTaskLoadTests, ObjectDataTests){
CalendarTaskObject testTask;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
}
-TEST(iCalendarTask, AlarmTests){
+TEST_F(iCalendarTaskLoadTests, AlarmTests){
CalendarTaskObject testTask;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendartask/CalendarTask.h"
+#include <gtest/gtest.h>
-TEST(iCalendarSaveTask, SaveTaskTests){
+class iCalendarTaskSaveTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarTaskSaveTests, SaveTaskTests){
CalendarTaskObject testTask;
CalendarTaskObject testTask2;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendartimezone/CalendarTimezone.h"
-
-TEST(iCalendarTimezone, BasicTests){
+#include <gtest/gtest.h>
+
+class iCalendarTimezoneLoadTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarTimezoneLoadTests, BasicTests){
CalendarTimezoneObject testTimezone;
}
-TEST(iCalendarTimezone, ObjectDataTests){
+TEST_F(iCalendarTimezoneLoadTests, ObjectDataTests){
CalendarTimezoneObject testTimezone;
ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load2.vcf"));
// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "../objects/calendartimezone/CalendarTimezone.h"
+#include <gtest/gtest.h>
-TEST(iCalendarSaveTimezone, SaveTimezoneTests){
+class iCalendarTimezoneSaveTests : public ::testing::Test
+{
+private:
+ virtual void SetUp()
+ {
+ }
+
+ virtual void TearDown()
+ {
+ }
+};
+
+TEST_F(iCalendarTimezoneSaveTests, SaveTimezoneTests){
CalendarTimezoneObject testTimezone;
CalendarTimezoneObject testTimezone2;
--- /dev/null
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{
+ ::testing::GTEST_FLAG(shuffle) = true;
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
+++ /dev/null
-// xestiacalendar_test.cpp - Xestia Calendar Unit Testing Suite.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <curl/curl.h>
-#include <gtest/gtest.h>
-#include <iostream>
-#include <string>
-#include <stdexcept>
-
-#include "xestiacalendar_commonfunctions.h"
-#include "xestiacalendar_populate.h"
-#include "xestiacalendar_icaleventload.h"
-#include "xestiacalendar_icaleventsave.h"
-#include "xestiacalendar_icaltaskload.h"
-#include "xestiacalendar_icaltasksave.h"
-#include "xestiacalendar_icaljournalload.h"
-#include "xestiacalendar_icaljournalsave.h"
-#include "xestiacalendar_icalfreebusyload.h"
-#include "xestiacalendar_icalfreebusysave.h"
-#include "xestiacalendar_icaltimezoneload.h"
-#include "xestiacalendar_icaltimezonesave.h"
-#include "xestiacalendar_calendardatastorage.h"
-#include "xestiacalendar_caldav.h"
-
-enum MenuOpts {
- TESTS_ICALLOADEVENT = 1,
- TESTS_ICALSAVEEVENT,
- TESTS_ICALLOADTODO,
- TESTS_ICALSAVETODO,
- TESTS_ICALLOADJOURNAL,
- TESTS_ICALSAVEJOURNAL,
- TESTS_ICALLOADFREEBUSY,
- TESTS_ICALSAVEFREEBUSY,
- TESTS_ICALLOADTIMEZONE,
- TESTS_ICALSAVETIMEZONE,
- TESTS_CALENDARDATASTORAGE,
- TESTS_CALDAV,
- TESTS_COMMONFUNCTIONS,
- TESTS_EXTRA,
- TESTS_QUIT
-};
-
-enum ExtraMenuOpts{
- EXTRA_POPULATECALDAV = 1,
- EXTRA_RETURN
-};
-
-void printn(std::string text){
-// printn: Print a line and end with a newline (\n).
-
- std::cout << text << std::endl;
-
-}
-
-void printmenu(){
-// printmenu: Print the menu.
-
- std::cout << "Select an option:" << std::endl << std::endl;
- std::cout << TESTS_ICALLOADEVENT << ". iCalendar Event Component Load" << std::endl;
- std::cout << TESTS_ICALSAVEEVENT << ". iCalendar Event Component Save" << std::endl;
- std::cout << TESTS_ICALLOADTODO << ". iCalendar Task Component Load" << std::endl;
- std::cout << TESTS_ICALSAVETODO << ". iCalendar Task Component Save" << std::endl;
- std::cout << TESTS_ICALLOADJOURNAL << ". iCalendar Journal Component Load" << std::endl;
- std::cout << TESTS_ICALSAVEJOURNAL << ". iCalendar Journal Component Save" << std::endl;
- std::cout << TESTS_ICALLOADFREEBUSY << ". iCalendar FreeBusy Component Load" << std::endl;
- std::cout << TESTS_ICALSAVEFREEBUSY << ". iCalendar FreeBusy Component Save" << std::endl;
- std::cout << TESTS_ICALLOADTIMEZONE << ". iCalendar Timezone Component Load" << std::endl;
- std::cout << TESTS_ICALSAVETIMEZONE << ". iCalendar Timezone Component Save" << std::endl;
- std::cout << TESTS_CALENDARDATASTORAGE << ". Calendar Data Storage" << std::endl;
- std::cout << TESTS_CALDAV << ". CalDAV Object" << std::endl;
- std::cout << TESTS_COMMONFUNCTIONS << ". Common Functions" << std::endl;
- std::cout << TESTS_EXTRA << ". Extra Functions Menu" << std::endl;
- std::cout << TESTS_QUIT << ". Quit" << std::endl;
- std::cout << std::endl;
-
-}
-
-void printextramenu(){
-
- std::cout << "Extra Functions Menu" << std::endl << std::endl;
- std::cout << "Select an option:" << std::endl << std::endl;
- std::cout << EXTRA_POPULATECALDAV << ". Populate CalDAV calendar" << std::endl;
- std::cout << EXTRA_RETURN << ". Return to previous menu" << std::endl;
- std::cout << std::endl;
-
-}
-
-void runextramenu(){
-
- bool exitEnabled = false;
- std::string stringOption = "";
- int testResult = 0;
-
- while(exitEnabled == false){
-
- printextramenu();
-
- // Get user input.
-
- std::cout << "Select Option: ";
- std::cin >> stringOption;
-
- int intOption = -1;
-
- // Check if input is a number.
-
- try{
- intOption = stoi(stringOption);
- }
-
- // Return to the top of the while statement if input
- // really isn't a number.
-
- catch(std::invalid_argument e){
- printn("Error: Selected option is not a number.");
- continue;
- }
-
- // Find which option has been selected from the
- // input.
-
- switch(intOption){
-
- case EXTRA_POPULATECALDAV:
- printn("Populating CalDAV calendar...");
- populatecaldav();
- break;
- case EXTRA_RETURN:
- return;
- break;
- default:
- printn("Invalid menu number given.");
- break;
-
- }
-
- }
-
-}
-
-int main(int argc, char* argv[]){
-
- // Initialise the several libraries that have
- // been included.
-
- ::testing::InitGoogleTest(&argc, argv);
- curl_global_init(CURL_GLOBAL_ALL);
-
- printn("Xestia Calendar Unit Testing Application");
- printn("(c)2016 Xestia Software Development");
- printn("Note: Unit testing is currently in development");
- printn("");
-
- bool exitEnabled = false;
- std::string stringOption = "";
- int testResult = 0;
-
- while(exitEnabled == false){
-
- printmenu();
-
- // Get user input.
-
- std::cout << "Select Option: ";
- std::cin >> stringOption;
-
- int intOption = -1;
-
- // Check if input is a number.
-
- try{
- intOption = stoi(stringOption);
- }
-
- // Return to the top of the while statement if input
- // really isn't a number.
-
- catch(std::invalid_argument e){
- printn("Error: Selected option is not a number.");
- continue;
- }
-
- // Find which option has been selected from the
- // input.
-
- switch(intOption){
-
- case TESTS_ICALLOADEVENT:
- printn("Running iCalendar Event Component tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarEvent*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALSAVEEVENT:
- printn("Running iCalendar Event Component Save tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarSaveEvent*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALLOADTODO:
- printn("Running iCalendar Task Component tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarTask*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALSAVETODO:
- printn("Running iCalendar Task Component Save tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarSaveTask*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALLOADJOURNAL:
- printn("Running iCalendar Journal Component tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarJournal*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALSAVEJOURNAL:
- printn("Running iCalendar Journal Component Save tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarSaveJournal*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALLOADFREEBUSY:
- printn("Running iCalendar Free Busy Component tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarFreeBusy*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALSAVEFREEBUSY:
- printn("Running iCalendar Free Busy Component Save tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarSaveFreeBusy*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALLOADTIMEZONE:
- printn("Running iCalendar Timezone Component tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarTimezone*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_ICALSAVETIMEZONE:
- printn("Running iCalendar Timezone Component Save tests...");
- ::testing::GTEST_FLAG(filter) = "iCalendarSaveTimezone*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_CALENDARDATASTORAGE:
- printn("Running Calendar Data Storage tests...");
- ::testing::GTEST_FLAG(filter) = "CalendarDataStorage*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_CALDAV:
- printn("Running CalDAV tests...");
- ::testing::GTEST_FLAG(filter) = "CalDAV*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_COMMONFUNCTIONS:
- printn("Running Commmon Functions tests...");
- ::testing::GTEST_FLAG(filter) = "CommonFunctions*";
- testResult = RUN_ALL_TESTS();
- break;
- case TESTS_EXTRA:
- runextramenu();
- break;
- case TESTS_QUIT:
- return 0;
- break;
- default:
- printn("Invalid menu number given.");
- break;
-
- }
-
- }
-
-}
+++ /dev/null
-// xestiacalendar_testcommon.cpp - Xestia Calendar Unit Test Common Functions.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <fstream>
-
-#include "xestiacalendar_testcommon.h"
-#include "../common/file.h"
-
-ProcessConnectionDataFileResult ProcessConnectionDataFile(string dataFilename,
- CalDAVConnectionData *connData){
-
- ProcessConnectionDataFileResult processResult = PROCESSCONNECTIONDATAFILE_UNITTESTFAIL;
-
- // Check if the file exists and return
- // PROCESSCONNECTIONDATAFILE_MISSING if not.
-
- if (!FileExists(dataFilename)){
- return PROCESSCONNECTIONDATAFILE_MISSING;
- }
-
- ifstream fileStream;
- string receivedStringData = "";
-
- fileStream.open(dataFilename, ifstream::in);
-
- if (fileStream.rdstate() & ifstream::failbit){
- return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
- }
-
- if (fileStream.rdstate() & ifstream::badbit){
- return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
- }
-
- // Process the file.
-
- char *bufferRead = new char[256];
-
- while (!fileStream.eof()){
-
- fileStream.getline(bufferRead, 256);
- receivedStringData.append(bufferRead);
- receivedStringData.append("\n");
-
- }
-
- delete[] bufferRead;
-
- bool newLine = false;
- bool skipMode = false;
- bool equalFound = false;
- bool quoteMode = false;
- bool serverNameFound = false;
- bool serverUserFound = false;
- bool serverPassFound = false;
- bool serverSSLFound = false;
- bool serverPortFound = false;
- bool serverPrefixFound = false;
- char bufferChar = 0;
- int stringDataSize = receivedStringData.size();
- int seekCount = 0;
- string propertyName;
- string propertyValue;
-
- while (seekCount < stringDataSize){
-
- if (receivedStringData[seekCount] == '='){
-
- equalFound = true;
-
- } else if (receivedStringData[seekCount] == '\n'){
-
- // Newline reached. Check for what type of
- // data it is.
-
- // Chceck that the equals sign has been found,
- // there is a values in the property name
- // and property value before doing anything.
-
- if (equalFound == true &&
- propertyName.size() > 0 &&
- propertyValue.size() > 0){
-
- if (propertyName == "server" && serverNameFound == false){
-
- // Setup the server hostname.
-
- connData->hostname = propertyValue;
- serverNameFound = true;
-
- } else if (propertyName == "port" && serverPortFound == false){
-
- // Setup the server port.
-
- int portNum;
- bool portNumValid = true;
-
- try{
- portNum = stoi(propertyValue);
- }
-
- catch(const invalid_argument &oor){
- portNumValid = false;
- }
-
- // Port Number is valid so add to the
- // CalDAVConnectionData handle.
-
- if (portNumValid == true){
- connData->port = portNum;
- serverPortFound = true;
- }
-
- } else if (propertyName == "user" && serverUserFound == false){
-
- // Setup the server user.
-
- connData->username = propertyValue;
- serverUserFound = true;
-
- } else if (propertyName == "pass" && serverPassFound == false){
-
- // Setup the server pass.
-
- connData->password = propertyValue;
- serverPassFound = true;
-
- } else if (propertyName == "ssl" && serverSSLFound == false){
-
- // Setup the server SSL status.
-
- if (propertyValue == "true"){
- connData->useSSL = true;
- } else {
- connData->useSSL = false;
- }
-
- serverSSLFound = true;
-
- } else if (propertyName == "prefix" && serverPrefixFound == false){
-
- // Setup the server prefix.
-
- connData->prefix = propertyValue;
- serverPrefixFound = true;
-
- }
-
- }
-
- // Reset the variables.
-
- equalFound = false;
- propertyName.clear();
- propertyValue.clear();
-
- } else {
-
- // No special character so add it to the
- // Property name or value depending on
- // if the equal sign has been found.
-
- bufferChar = receivedStringData[seekCount];
-
- if (equalFound == true){
- propertyValue += bufferChar;
- } else {
- propertyName += bufferChar;
- }
-
- bufferChar = 0;
-
- }
-
- seekCount++;
-
- }
-
- // Check that the CalDAV connection data object
- // contains valid data.
-
- bool calDAVConnDataResult = CalDAVObjectValidSettings(connData);
-
- if (calDAVConnDataResult == false){
- processResult = PROCESSCONNECTIONDATAFILE_INVALID;
- } else {
- processResult = PROCESSCONNECTIONDATAFILE_OK;
- }
-
- return processResult;
-
-}
\ No newline at end of file
+++ /dev/null
-// xestiacalendar_testcommon.h - Xestia Calendar Unit Test Common Functions Header.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#ifndef __TESTS_XESTIACALENDAR_TESTCOMMON_H__
-#define __TESTS_XESTIACALENDAR_TESTCOMMON_H__
-
-#include "../objects/CalDAV/CalDAV.h"
-#include <string>
-#include <stdexcept>
-
-using namespace std;
-
-enum ProcessConnectionDataFileResult{
- PROCESSCONNECTIONDATAFILE_UNITTESTFAIL = -1,
- PROCESSCONNECTIONDATAFILE_OK,
- PROCESSCONNECTIONDATAFILE_MISSING,
- PROCESSCONNECTIONDATAFILE_CANNOTOPEN,
- PROCESSCONNECTIONDATAFILE_INVALID
-};
-
-ProcessConnectionDataFileResult ProcessConnectionDataFile(string dataFilename,
- CalDAVConnectionData *connData);
-
-#endif
\ No newline at end of file
+++ /dev/null
-// xestiacalendar_testxccalendarday.cpp - Xestia Calendar Unit Test XCCalendarDay
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <wx/wx.h>
-#include "../widgets/XCCalendarDay.h"
-
-class XCCalendarDayTest: public wxApp
-{
- virtual bool OnInit();
-};
-
-IMPLEMENT_APP(XCCalendarDayTest);
-
-using namespace std;
-
-bool XCCalendarDayTest::OnInit()
-{
-
- XCCalendarDay *frmMain = new XCCalendarDay(NULL, "XCCalendarDay Test", wxPoint(50, 50), wxSize(200, 200) );
-
- frmMain->Show();
- SetTopWindow(frmMain);
-
- return true;
-
-}
\ No newline at end of file
+++ /dev/null
-// xestiacalendar_testxccalendarmonthview.cpp - Xestia Calendar Unit Test XCCalendarMonthView
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <wx/wx.h>
-#include "../widgets/XCCalendarMonthView.h"
-#include "../common/monthviewgen.h"
-
-class XCCalendarMonthViewTest: public wxApp
-{
- virtual bool OnInit();
-};
-
-IMPLEMENT_APP(XCCalendarMonthViewTest);
-
-using namespace std;
-
-bool XCCalendarMonthViewTest::OnInit()
-{
-
- XCCalendarMonthViewGrid MonthViewGrid = GenerateMonthGrid(6, 2016);
-
- XCCalendarMonthView *frmMain = new XCCalendarMonthView("XCCalendarMonthView Test", wxPoint(50, 50), wxSize(200, 200), &MonthViewGrid);
-
- frmMain->Show();
- SetTopWindow(frmMain);
-
- return true;
-
-}
\ No newline at end of file