Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests to check that the connection fails using invalid settings.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 29 Feb 2016 03:26:06 +0000 (03:26 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 29 Feb 2016 03:26:06 +0000 (03:26 +0000)
source/tests/xestiacalendar_caldav.h

index c4db5ba..e8932b8 100644 (file)
@@ -157,6 +157,30 @@ TEST(CalDAV, BasicTests){
        // Do another connection and this time the connection should
        // fail due to being an invalid host name.
        
+       CalDAVConnectionData ConnPlainFail;
+       ConnPlainFail.Hostname = "server.invalid";
+       ConnPlainFail.Username = "fail";
+       ConnPlainFail.Password = "fail";
+       ConnPlainFail.Port = 80;
+       ConnPlainFail.UseSSL = false;
+       
+       // Setup the CalDAV connection object.
+       
+       CalDAV CalDAVPlainFail;
+       CalDAVPlainFail.SetupConnectionData(&ConnPlainFail);
+       
+       // Setup the CalDAVStatus object.
+       
+       CalDAVStatus CalDAVPlainFailStatus = CalDAVPlain.GetConnectionData();
+       
+       // Connect and fail.
+       
+       ConnResult = CalDAVPlainFail.Connect();
+       
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
+       ASSERT_EQ(0, ConnResult.HTTPCode);
+       ASSERT_EQ(CURLE_COULDNT_RESOLVE_HOST, ConnResult.Code);
+       
        // (*nix version) Setup an initial connection (with a valid
        // SSL certificate).
        
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