}
// Check that the vCard is a valid vCard 4.0 file.
+
+
+ vCard vCard4FormatCheck;
+
+ vCard4FormatCheck.LoadFile(Filename);
+ if (vCard4FormatCheck.Get("VERSION") != wxT("4.0")){
+ return CONTACTLOAD_FILEINVALIDFORMAT;
+
+ }
return CONTACTLOAD_UNITTESTFAIL;
#define __CLIENTDATAOBJECT_H__
#include <wx/wx.h>
+#include <wx/file.h>
#include <map>
+#include "../vcard/vcard.h"
enum ContactLoadStatus{
CONTACTLOAD_UNITTESTFAIL = -1,
- CONTACTLOAD_FILEMISSING
+ CONTACTLOAD_FILEMISSING,
+ CONTACTLOAD_FILEERROR,
+ CONTACTLOAD_FILEINVALIDFORMAT
};
class ContactDataObject{
// open it.
ASSERT_EQ(CONTACTLOAD_FILEERROR, TestFile.LoadFile("InvalidPermissions.vcf"));
+
+ // Check that the file is a valid vCard 4.0 file.
+
+ ASSERT_EQ(CONTACTLOAD_FILEINVALIDFORMAT, TestFile.LoadFile("LoadCheck-Load1-v3.vcf"));
}