Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Aded unit tests for checking when a server timeouts.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 1 Mar 2016 17:06:06 +0000 (17:06 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 1 Mar 2016 17:06:06 +0000 (17:06 +0000)
source/tests/xestiacalendar_caldav.h

index 45da6f7..e2660fb 100644 (file)
@@ -59,7 +59,7 @@ TEST(CalDAV, BasicTests){
        
        // Attempt to read the caldavtest-timeout.auth file.
        
-       DataFileResult = ProcessConnectionDataFile("caldavtest-fail.auth", &ConnTimeout);
+       DataFileResult = ProcessConnectionDataFile("caldavtest-timeout.auth", &ConnTimeout);
        if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
                ValidDataTimeout = true;
        }
@@ -236,6 +236,26 @@ TEST(CalDAV, BasicTests){
        // (*nix version) Setup an inital connection on a server where
        // a timeout occurs.
        
+       CalDAV CalDAVTimeout;
+       CalDAVTimeout.SetupConnectionData(&ConnTimeout);
+
+       // Verify that the settings match with the CalDAVConnectionData
+       // passed.
+       
+       CalDAVStatus CalDAVTimeoutStatus = CalDAVTimeout.GetConnectionData();
+       
+       ASSERT_EQ(CalDAVTimeoutStatus.Hostname, ConnTimeout.Hostname);
+       ASSERT_EQ(CalDAVTimeoutStatus.Username, ConnTimeout.Username);
+       ASSERT_EQ(CalDAVTimeoutStatus.Port, ConnTimeout.Port);
+       ASSERT_EQ(CalDAVTimeoutStatus.Prefix, ConnTimeout.Prefix);
+       ASSERT_EQ(CalDAVTimeoutStatus.UseSSL, ConnTimeout.UseSSL);
+       
        // Verify that the connection had timed out.
        
+       ConnResult = CalDAVTimeout.Connect();
+       
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
+       ASSERT_EQ(0, ConnResult.HTTPCode);
+       ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, ConnResult.Code);
+       
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy