Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added test and code to check if an error occured whilst opening the input file.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 5 Dec 2015 23:44:26 +0000 (23:44 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 5 Dec 2015 23:44:26 +0000 (23:44 +0000)
source/convert.cpp
source/convert.h
source/tests/xestiaab_convert.h

index 8f6d7d1..69926de 100644 (file)
@@ -80,6 +80,16 @@ ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat,
                
        }
        
+       wxFile InputFile;
+       
+       if (!InputFile.Open(InputFilename, wxFile::read, wxS_DEFAULT)){
+               
+               int InputFileErrNo = InputFile.GetLastError();
+               
+               return CONVERTRESULT_INPUTFILEERROR;
+               
+       }
+       
        return CONVERTRESULT_OK;
        
 }
\ No newline at end of file
index e1e438e..af99f8c 100644 (file)
@@ -20,6 +20,7 @@
 #define __CONVERT_H__
 
 #include <wx/wx.h>
+#include <wx/file.h>
 #include <string>
 #include <vector>
 
index 2b185c0..7f3d3a7 100644 (file)
@@ -59,6 +59,11 @@ TEST(ConvertCmdLine, ConvertTests){
        ASSERT_EQ(CONVERTRESULT_INPUTFILEMISSING, ConvertContact(wxT("vCard3"), 
                wxT("vCard4"), 
                wxT("InvalidFile.vcf"), 
-               wxT("Temp-LoadCheck-Load1-v3Conv.vcf"))); 
+               wxT("Temp-LoadCheck-Load1-v3Conv.vcf")));
+
+       ASSERT_EQ(CONVERTRESULT_INPUTFILEERROR, ConvertContact(wxT("vCard3"), 
+               wxT("vCard4"), 
+               wxT("InvalidPermissions.vcf"), 
+               wxT("Temp-LoadCheck-Load1-v3Conv.vcf")));
 
 }
\ 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