Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for checking the invalid SSL certificate.
[xestiacalendar/.git] / source / tests / xestiacalendar_caldav.h
index fbb8968..45da6f7 100644 (file)
@@ -201,12 +201,38 @@ TEST(CalDAV, BasicTests){
        // Verify that the connection was successful (with a valid
        // SSL certificate).
        
+       ConnResult = CalDAVNormal.Connect();
+       
+       ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+       ASSERT_EQ(200, ConnResult.HTTPCode);
+       ASSERT_EQ(CURLE_OK, ConnResult.Code);
+       
        // (*nix version) Setup an initial connection on a server that
        // will fail due to having an invalid SSL certificate.
 
+       CalDAV CalDAVInvalidSSL;
+       CalDAVInvalidSSL.SetupConnectionData(&ConnInvalidSSL);
+
+       // Verify that the settings match with the CalDAVConnectionData
+       // passed.
+       
+       CalDAVStatus CalDAVInvalidSSLStatus = CalDAVInvalidSSL.GetConnectionData();
+       
+       ASSERT_EQ(CalDAVInvalidSSLStatus.Hostname, ConnInvalidSSL.Hostname);
+       ASSERT_EQ(CalDAVInvalidSSLStatus.Username, ConnInvalidSSL.Username);
+       ASSERT_EQ(CalDAVInvalidSSLStatus.Port, ConnInvalidSSL.Port);
+       ASSERT_EQ(CalDAVInvalidSSLStatus.Prefix, ConnInvalidSSL.Prefix);
+       ASSERT_EQ(CalDAVInvalidSSLStatus.UseSSL, ConnInvalidSSL.UseSSL);
+       
        // Verify that the connection had failed. (with an invalid
        // SSL certificate).
        
+       ConnResult = CalDAVInvalidSSL.Connect();
+       
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
+       ASSERT_EQ(0, ConnResult.HTTPCode);
+       ASSERT_EQ(CURLE_SSL_CACERT, ConnResult.Code);
+       
        // (*nix version) Setup an inital connection on a server where
        // a timeout occurs.
        
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