diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 31fe4234..bf73428b 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -91,13 +91,14 @@ 4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */; }; 4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */; }; 4C4436771792BE810099E220 /* KPKFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4436761792BE810099E220 /* KPKFormat.m */; }; - 4C45FB1C178E09ED0010007D /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C45FB1B178E09ED0010007D /* SenTestingKit.framework */; }; 4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; }; 4C45FB23178E09ED0010007D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C45FB21178E09ED0010007D /* InfoPlist.strings */; }; 4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */; }; 4C45FB30178E0CE20010007D /* MPDatabaseCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */; }; 4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; }; 4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */; }; + 4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C473A7E18AFD6340073FD2E /* KPKTestReference.m */; }; + 4C473A8718AFD85B0073FD2E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C473A8518AFD7250073FD2E /* XCTest.framework */; }; 4C4A100F176286FD00BBF2CA /* MPTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A100E176286FD00BBF2CA /* MPTableView.m */; }; 4C4B7EE917A45EC6000234C7 /* MPDatePickingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EE717A45EC5000234C7 /* MPDatePickingViewController.m */; }; 4C4B7EEA17A45EC6000234C7 /* DatePickingView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C4B7EE817A45EC5000234C7 /* DatePickingView.xib */; }; @@ -252,6 +253,7 @@ 4CD884B715BD47080042BBF8 /* DocumentWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */; }; 4CDB5C421794AA4F0017667E /* KPKTree+Serializing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */; }; 4CDF01A316D1B76700D0AC08 /* MPEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDF01A216D1B76700D0AC08 /* MPEntryViewController.m */; }; + 4CDFD35818AED5C5002BB267 /* KPKAutotypeCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDFD35718AED5C5002BB267 /* KPKAutotypeCommands.m */; }; 4CE2961518429AA5005F01CE /* MPAutotypeKeyPress.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2961418429AA5005F01CE /* MPAutotypeKeyPress.m */; }; 4CE296191842A166005F01CE /* MPAutotypePaste.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE296181842A166005F01CE /* MPAutotypePaste.m */; }; 4CE298EB1795FC2A00DF7BDB /* MPEntryContextMenuDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE298EA1795FC2A00DF7BDB /* MPEntryContextMenuDelegate.m */; }; @@ -379,7 +381,6 @@ 4C1842B1179B28C400E2F5BC /* KPKLegacyTreeReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyTreeReader.m; sourceTree = ""; }; 4C1842B3179B28D400E2F5BC /* KPKLegacyTreeWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKLegacyTreeWriter.h; sourceTree = ""; }; 4C1842B4179B28D400E2F5BC /* KPKLegacyTreeWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyTreeWriter.m; sourceTree = ""; }; - 4C1842B6179B348600E2F5BC /* KPKTestLegacyLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestLegacyLoading.h; sourceTree = ""; }; 4C1842B7179B348600E2F5BC /* KPKTestLegacyLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestLegacyLoading.m; sourceTree = ""; }; 4C1842B9179B3A1700E2F5BC /* KPKXmlFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KPKXmlFormat.h; path = Format/KPKXmlFormat.h; sourceTree = ""; }; 4C1842BA179B434C00E2F5BC /* KPKXmlHeaderReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKXmlHeaderReader.h; sourceTree = ""; }; @@ -398,7 +399,6 @@ 4C1842D5179C6F1800E2F5BC /* KPKHeaderWriting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPKHeaderWriting.h; sourceTree = ""; }; 4C18F9AA178E122500890BCE /* Test_Password_1234.kdb */ = {isa = PBXFileReference; lastKnownFileType = file; name = Test_Password_1234.kdb; path = Databases/Test_Password_1234.kdb; sourceTree = ""; }; 4C19E4FF178E26EF002F2CD0 /* Test_Password_1234.kdbx */ = {isa = PBXFileReference; lastKnownFileType = file; name = Test_Password_1234.kdbx; path = Databases/Test_Password_1234.kdbx; sourceTree = ""; }; - 4C19E501178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabasePasswordAndKeyfile.h; sourceTree = ""; }; 4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabasePasswordAndKeyfile.m; sourceTree = ""; }; 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordCreatorWindow.xib; sourceTree = ""; }; 4C1E9883185F71A800943563 /* MPContextBarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPContextBarViewController.h; sourceTree = ""; }; @@ -474,7 +474,6 @@ 4C2E382516D1470200037A9D /* MPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPViewController.m; sourceTree = ""; }; 4C305F34179A0BD70082334F /* KPKIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKIcon.h; sourceTree = ""; }; 4C305F35179A0BD70082334F /* KPKIcon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKIcon.m; sourceTree = ""; }; - 4C305F3A179A19F90082334F /* KPKIconLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKIconLoading.h; sourceTree = ""; }; 4C305F3B179A19F90082334F /* KPKIconLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKIconLoading.m; sourceTree = ""; }; 4C305F3D179A1A760082334F /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = image.png; path = Images/image.png; sourceTree = ""; }; 4C3666401787327E00B249F1 /* MPDocument+Attachments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MPDocument+Attachments.m"; sourceTree = ""; }; @@ -497,19 +496,18 @@ 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OverlayWindow.xib; sourceTree = ""; }; 4C4436751792BE810099E220 /* KPKFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KPKFormat.h; path = Format/KPKFormat.h; sourceTree = ""; }; 4C4436761792BE810099E220 /* KPKFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = KPKFormat.m; path = Format/KPKFormat.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4C45FB1A178E09ED0010007D /* MacPassTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacPassTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C45FB1B178E09ED0010007D /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; + 4C45FB1A178E09ED0010007D /* MacPassTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacPassTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 4C45FB20178E09ED0010007D /* MacPassTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MacPassTests-Info.plist"; sourceTree = ""; }; 4C45FB22178E09ED0010007D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 4C45FB27178E09ED0010007D /* MacPassTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MacPassTests-Prefix.pch"; sourceTree = ""; }; - 4C45FB2B178E0BCB0010007D /* MPDatabaseLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseLoading.h; sourceTree = ""; }; 4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseLoading.m; sourceTree = ""; }; - 4C45FB2E178E0CE20010007D /* MPDatabaseCreation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseCreation.h; sourceTree = ""; }; 4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseCreation.m; sourceTree = ""; }; 4C46B88317063A070046109A /* NSString+MPPasswordCreation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MPPasswordCreation.h"; sourceTree = ""; }; 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MPPasswordCreation.m"; sourceTree = ""; }; 4C46E09C17673A0A00DA62E8 /* HNHShadowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHShadowBox.h; sourceTree = ""; }; 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHShadowBox.m; sourceTree = ""; }; + 4C473A7E18AFD6340073FD2E /* KPKTestReference.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestReference.m; sourceTree = ""; }; + 4C473A8518AFD7250073FD2E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 4C4A100D176286FD00BBF2CA /* MPTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPTableView.h; sourceTree = ""; }; 4C4A100E176286FD00BBF2CA /* MPTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTableView.m; sourceTree = ""; }; 4C4B7EE617A45EC5000234C7 /* MPDatePickingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatePickingViewController.h; sourceTree = ""; }; @@ -594,7 +592,6 @@ 4C61EA0416D2FFE200AC519E /* OutlineView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OutlineView.xib; sourceTree = ""; }; 4C6366AA17AF1E0100AAF17D /* NSColor+KeePassKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+KeePassKit.h"; sourceTree = ""; }; 4C6366AB17AF1E0100AAF17D /* NSColor+KeePassKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSColor+KeePassKit.m"; sourceTree = ""; }; - 4C6366AD17AF207600AAF17D /* KPKTestHexColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestHexColor.h; sourceTree = ""; }; 4C6366AE17AF207600AAF17D /* KPKTestHexColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestHexColor.m; sourceTree = ""; }; 4C6366B017AFB52500AAF17D /* CustomIcon_Password_1234.kdbx */ = {isa = PBXFileReference; lastKnownFileType = file; name = CustomIcon_Password_1234.kdbx; path = Databases/CustomIcon_Password_1234.kdbx; sourceTree = ""; }; 4C6366B117AFB52500AAF17D /* CustomIcon_Password_1234.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = CustomIcon_Password_1234.xml; path = Databases/CustomIcon_Password_1234.xml; sourceTree = ""; }; @@ -623,7 +620,6 @@ 4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 48_FolderTemplate.pdf; sourceTree = ""; }; 4C6D1D26178586CA0014C5A5 /* 99_AddFolderTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = 99_AddFolderTemplate.pdf; path = Icons/99_AddFolderTemplate.pdf; sourceTree = ""; }; 4C6D1D2A17858A250014C5A5 /* MacPass.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = MacPass.icns; path = "../Assets/App icon/MacPass.icns"; sourceTree = ""; }; - 4C6FDD1F17BC4F4C004AEEC8 /* KPKTestPlaceholder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestPlaceholder.h; sourceTree = ""; }; 4C6FDD2017BC4F4C004AEEC8 /* KPKTestPlaceholder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestPlaceholder.m; sourceTree = ""; }; 4C701CBB178618A000581B88 /* 12_RemoteTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 12_RemoteTemplate.pdf; sourceTree = ""; }; 4C70D0FE179092F200652EE9 /* KPKCompositeKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKCompositeKey.h; sourceTree = ""; }; @@ -658,9 +654,7 @@ 4C79DF29176685870083708F /* HNHRoundedTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHRoundedTextField.m; sourceTree = ""; }; 4C79E80117A9187400AC6CD2 /* KPKXmlHeaderWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKXmlHeaderWriter.h; sourceTree = ""; }; 4C79E80217A9187400AC6CD2 /* KPKXmlHeaderWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKXmlHeaderWriter.m; sourceTree = ""; }; - 4C79E80417A9400500AC6CD2 /* KPKTestNSCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestNSCoding.h; sourceTree = ""; }; 4C79E80517A9400500AC6CD2 /* KPKTestNSCoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestNSCoding.m; sourceTree = ""; }; - 4C79E80717A9485600AC6CD2 /* KPKTestNSCopying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestNSCopying.h; sourceTree = ""; }; 4C79E80817A9485600AC6CD2 /* KPKTestNSCopying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestNSCopying.m; sourceTree = ""; }; 4C7ABA4317BAEC6700FF5799 /* 15_ScannerTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 15_ScannerTemplate.pdf; sourceTree = ""; }; 4C7ABA4417BAEC6700FF5799 /* 16_BrowserTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 16_BrowserTemplate.pdf; sourceTree = ""; }; @@ -711,7 +705,6 @@ 4CA3530A18A53CB800839B0F /* MPKeyMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKeyMapper.m; sourceTree = ""; }; 4CA3531118A5577300839B0F /* dsa_sparkle_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_sparkle_pub.pem; sourceTree = ""; }; 4CAAFDD51787AED60013FCF9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = ""; }; - 4CAC614117AD319200023F9E /* KPKTestXmlParsing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestXmlParsing.h; sourceTree = ""; }; 4CAC614217AD319200023F9E /* KPKTestXmlParsing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestXmlParsing.m; sourceTree = ""; }; 4CAD745615B887FD00104512 /* DDXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDXMLElementAdditions.h; sourceTree = ""; }; 4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDXMLElementAdditions.m; sourceTree = ""; }; @@ -734,7 +727,6 @@ 4CB9339816D3A0DD00A13B5D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 4CBA2AB617074B59006D8139 /* MPSettingsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSettingsHelper.h; sourceTree = ""; }; 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSettingsHelper.m; sourceTree = ""; }; - 4CBA561417C2EA4900CE13D3 /* KPKTestXmlWriting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestXmlWriting.h; sourceTree = ""; }; 4CBA561517C2EA4900CE13D3 /* KPKTestXmlWriting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestXmlWriting.m; sourceTree = ""; }; 4CC0D2CC17974A47000B4BDA /* MPCustomFieldTableViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCustomFieldTableViewDelegate.h; sourceTree = ""; }; 4CC0D2CD17974A47000B4BDA /* MPCustomFieldTableViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCustomFieldTableViewDelegate.m; sourceTree = ""; }; @@ -793,6 +785,8 @@ 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "KPKTree+Serializing.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4CDF01A116D1B76700D0AC08 /* MPEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntryViewController.h; sourceTree = ""; }; 4CDF01A216D1B76700D0AC08 /* MPEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEntryViewController.m; sourceTree = ""; }; + 4CDFD35618AED5C5002BB267 /* KPKAutotypeCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KPKAutotypeCommands.h; path = Format/KPKAutotypeCommands.h; sourceTree = ""; }; + 4CDFD35718AED5C5002BB267 /* KPKAutotypeCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KPKAutotypeCommands.m; path = Format/KPKAutotypeCommands.m; sourceTree = ""; }; 4CE2961318429AA5005F01CE /* MPAutotypeKeyPress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAutotypeKeyPress.h; sourceTree = ""; }; 4CE2961418429AA5005F01CE /* MPAutotypeKeyPress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeKeyPress.m; sourceTree = ""; }; 4CE296171842A166005F01CE /* MPAutotypePaste.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAutotypePaste.h; sourceTree = ""; }; @@ -808,7 +802,6 @@ 4CE3E62517AB0D2D00D9E4B4 /* MPAttachmentTableDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAttachmentTableDataSource.m; sourceTree = ""; }; 4CE5B548173AFBA700207B39 /* MPDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDocument.h; sourceTree = ""; }; 4CE5B549173AFBA700207B39 /* MPDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocument.m; sourceTree = ""; }; - 4CE76DAB17B3AD010043B82B /* KPKHashedDataTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKHashedDataTest.h; sourceTree = ""; }; 4CE76DAC17B3AD010043B82B /* KPKHashedDataTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKHashedDataTest.m; sourceTree = ""; }; 4CE8246D16E2E93400573141 /* MPOverlayWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOverlayWindowController.h; sourceTree = ""; }; 4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayWindowController.m; sourceTree = ""; }; @@ -818,9 +811,7 @@ 4CE88C2417C163FE00BFD195 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 4CE88C3317C1647400BFD195 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 4CEAF85617BA9B1D001307A6 /* Keepass2Key.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = Keepass2Key.xml; path = Keyfiles/Keepass2Key.xml; sourceTree = ""; }; - 4CEAF85917BA9B44001307A6 /* KPKTestKeyfileParsing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestKeyfileParsing.h; sourceTree = ""; }; 4CEAF85A17BA9B44001307A6 /* KPKTestKeyfileParsing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestKeyfileParsing.m; sourceTree = ""; }; - 4CECB31517AC326D00EAFB0F /* KPKTestLegacyWriting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestLegacyWriting.h; sourceTree = ""; }; 4CECB31617AC326D00EAFB0F /* KPKTestLegacyWriting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestLegacyWriting.m; sourceTree = ""; }; 4CEE46DB181C301D006BF1E5 /* MPAutotypeDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAutotypeDaemon.h; sourceTree = ""; }; 4CEE46DC181C301D006BF1E5 /* MPAutotypeDaemon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeDaemon.m; sourceTree = ""; }; @@ -853,7 +844,6 @@ 4CFC873C179DF200000DFC03 /* KPKTimeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTimeInfo.h; sourceTree = ""; }; 4CFC873D179DF200000DFC03 /* KPKTimeInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTimeInfo.m; sourceTree = ""; }; 4CFC873F179DF295000DFC03 /* KPKTimerecording.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPKTimerecording.h; sourceTree = ""; }; - 4CFC8741179DFD3E000DFC03 /* KPKTestXmlLoading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKTestXmlLoading.h; sourceTree = ""; }; 4CFC8742179DFD3E000DFC03 /* KPKTestXmlLoading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKTestXmlLoading.m; sourceTree = ""; }; 4CFDDDE7185E92A600A9E7F1 /* HNHTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTextView.h; sourceTree = ""; }; 4CFDDDE8185E92A600A9E7F1 /* HNHTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTextView.m; sourceTree = ""; }; @@ -865,7 +855,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4C45FB1C178E09ED0010007D /* SenTestingKit.framework in Frameworks */, + 4C473A8718AFD85B0073FD2E /* XCTest.framework in Frameworks */, 4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -968,6 +958,8 @@ 4C08C3AF17B3036500BBBC95 /* KPKLegacyFormat.h */, 4CD4900E18513C180017397F /* KPKXmlElements.h */, 4CD4900F18513C180017397F /* KPKXmlElements.m */, + 4CDFD35618AED5C5002BB267 /* KPKAutotypeCommands.h */, + 4CDFD35718AED5C5002BB267 /* KPKAutotypeCommands.m */, ); name = Format; sourceTree = ""; @@ -1229,37 +1221,23 @@ 4CEAF85817BA9B25001307A6 /* Keyfiles */, 4C305F3F179A1A790082334F /* Images */, 4C18F9AC178E123200890BCE /* Databases */, - 4C45FB2B178E0BCB0010007D /* MPDatabaseLoading.h */, 4C45FB2C178E0BCB0010007D /* MPDatabaseLoading.m */, - 4C45FB2E178E0CE20010007D /* MPDatabaseCreation.h */, 4C45FB2F178E0CE20010007D /* MPDatabaseCreation.m */, - 4C19E501178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.h */, 4C19E502178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m */, 4C45FB1F178E09ED0010007D /* Supporting Files */, - 4C305F3A179A19F90082334F /* KPKIconLoading.h */, 4C305F3B179A19F90082334F /* KPKIconLoading.m */, - 4C1842B6179B348600E2F5BC /* KPKTestLegacyLoading.h */, 4C1842B7179B348600E2F5BC /* KPKTestLegacyLoading.m */, - 4CECB31517AC326D00EAFB0F /* KPKTestLegacyWriting.h */, 4CECB31617AC326D00EAFB0F /* KPKTestLegacyWriting.m */, - 4CFC8741179DFD3E000DFC03 /* KPKTestXmlLoading.h */, 4CFC8742179DFD3E000DFC03 /* KPKTestXmlLoading.m */, - 4C79E80417A9400500AC6CD2 /* KPKTestNSCoding.h */, 4C79E80517A9400500AC6CD2 /* KPKTestNSCoding.m */, - 4C79E80717A9485600AC6CD2 /* KPKTestNSCopying.h */, 4C79E80817A9485600AC6CD2 /* KPKTestNSCopying.m */, - 4CAC614117AD319200023F9E /* KPKTestXmlParsing.h */, 4CAC614217AD319200023F9E /* KPKTestXmlParsing.m */, - 4C6366AD17AF207600AAF17D /* KPKTestHexColor.h */, 4C6366AE17AF207600AAF17D /* KPKTestHexColor.m */, - 4CE76DAB17B3AD010043B82B /* KPKHashedDataTest.h */, 4CE76DAC17B3AD010043B82B /* KPKHashedDataTest.m */, - 4CEAF85917BA9B44001307A6 /* KPKTestKeyfileParsing.h */, 4CEAF85A17BA9B44001307A6 /* KPKTestKeyfileParsing.m */, - 4C6FDD1F17BC4F4C004AEEC8 /* KPKTestPlaceholder.h */, 4C6FDD2017BC4F4C004AEEC8 /* KPKTestPlaceholder.m */, - 4CBA561417C2EA4900CE13D3 /* KPKTestXmlWriting.h */, 4CBA561517C2EA4900CE13D3 /* KPKTestXmlWriting.m */, + 4C473A7E18AFD6340073FD2E /* KPKTestReference.m */, ); path = MacPassTests; sourceTree = ""; @@ -1348,7 +1326,7 @@ isa = PBXGroup; children = ( 4C77E36215B84A240093A587 /* MacPass.app */, - 4C45FB1A178E09ED0010007D /* MacPassTests.octest */, + 4C45FB1A178E09ED0010007D /* MacPassTests.xctest */, ); name = Products; sourceTree = ""; @@ -1356,12 +1334,12 @@ 4C77E36515B84A240093A587 /* Frameworks */ = { isa = PBXGroup; children = ( + 4C473A8518AFD7250073FD2E /* XCTest.framework */, 4CAD748D15B88AC100104512 /* libz.dylib */, 4C00E33A17D8FAC100F37192 /* Carbon.framework */, 4C8FECC716D57E3200BF26CF /* QuartzCore.framework */, 4CAD748B15B889B700104512 /* Security.framework */, 4C77E36615B84A240093A587 /* Cocoa.framework */, - 4C45FB1B178E09ED0010007D /* SenTestingKit.framework */, 4CE88C2417C163FE00BFD195 /* CoreFoundation.framework */, 4CE88C3317C1647400BFD195 /* Foundation.framework */, 4C77E36815B84A240093A587 /* Other Frameworks */, @@ -1831,7 +1809,6 @@ 4C45FB15178E09ED0010007D /* Sources */, 4C45FB16178E09ED0010007D /* Frameworks */, 4C45FB17178E09ED0010007D /* Resources */, - 4C45FB18178E09ED0010007D /* ShellScript */, ); buildRules = ( ); @@ -1839,8 +1816,8 @@ ); name = MacPassTests; productName = MacPassTests; - productReference = 4C45FB1A178E09ED0010007D /* MacPassTests.octest */; - productType = "com.apple.product-type.bundle"; + productReference = 4C45FB1A178E09ED0010007D /* MacPassTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; }; 4C77E36115B84A240093A587 /* MacPass */ = { isa = PBXNativeTarget; @@ -2033,19 +2010,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 4C45FB18178E09ED0010007D /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; - }; 4CC5D36818A1353400AF7FA8 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2068,6 +2032,7 @@ files = ( 4C45FB2D178E0BCB0010007D /* MPDatabaseLoading.m in Sources */, 4C45FB30178E0CE20010007D /* MPDatabaseCreation.m in Sources */, + 4C473A7F18AFD6340073FD2E /* KPKTestReference.m in Sources */, 4C19E503178E2871002F2CD0 /* MPDatabasePasswordAndKeyfile.m in Sources */, 4C305F3C179A19F90082334F /* KPKIconLoading.m in Sources */, 4C1842B8179B348600E2F5BC /* KPKTestLegacyLoading.m in Sources */, @@ -2243,6 +2208,7 @@ 4C79E80317A9187400AC6CD2 /* KPKXmlHeaderWriter.m in Sources */, 4CE3E62617AB0D2D00D9E4B4 /* MPAttachmentTableDataSource.m in Sources */, 4C6366AC17AF1E0100AAF17D /* NSColor+KeePassKit.m in Sources */, + 4CDFD35818AED5C5002BB267 /* KPKAutotypeCommands.m in Sources */, 4C08C3AE17B3022400BBBC95 /* KPKLegacyHeaderWriter.m in Sources */, 4C0728BD17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m in Sources */, 4C0F647817B6B65E00D9522A /* MPSheetWindowController.m in Sources */, @@ -2379,13 +2345,16 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + FRAMEWORK_SEARCH_PATHS = ( + "\\\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\\\"", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch"; INFOPLIST_FILE = "MacPassTests/MacPassTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; }; name = Debug; }; @@ -2398,13 +2367,16 @@ CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\""; + FRAMEWORK_SEARCH_PATHS = ( + "\\\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\\\"", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch"; INFOPLIST_FILE = "MacPassTests/MacPassTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; }; name = Release; }; diff --git a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme index 6613ca3f..da188ca5 100644 --- a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme +++ b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme @@ -37,50 +37,6 @@ BlueprintName = "MacPassTests" ReferencedContainer = "container:MacPass.xcodeproj"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MacPass/MPAutotypeCommand.h b/MacPass/MPAutotypeCommand.h index 36234fd9..b4f5a3a6 100644 --- a/MacPass/MPAutotypeCommand.h +++ b/MacPass/MPAutotypeCommand.h @@ -8,12 +8,6 @@ #import -extern NSString *const kMPAutotypeSymbolShift; -extern NSString *const kMPAutotypeSymbolControl; -extern NSString *const kMPAutotypeSymbolAlt; -extern NSString *const kMPAutotypeSymbolEnter; -extern NSString *const kMPAutptypeCommandEnter; - @class MPAutotypeContext; /** diff --git a/MacPass/MPAutotypeCommand.m b/MacPass/MPAutotypeCommand.m index aa46adb5..e8fdaafd 100644 --- a/MacPass/MPAutotypeCommand.m +++ b/MacPass/MPAutotypeCommand.m @@ -13,79 +13,6 @@ #import -NSString *const kMPAutotypeSymbolShift = @"+"; -NSString *const kMPAutotypeSymbolControl = @"^"; -NSString *const kMPAutotypeSymbolAlt = @"%"; -NSString *const kMPAutotypeSymbolEnter = @"~"; -NSString *const kMPAutptypeCommandEnter = @"{ENTER}"; -NSString *const kMPAutotypeCommandTab = @"{TAB}"; -NSString *const kMPAutotypeCommandUp = @"{UP}"; -NSString *const kMPAutotypeCommandDown = @"{DOWN}"; -NSString *const kMPAutotypeCommandLeft = @"{LEFT}"; -NSString *const kMPAutotypeCommandRight = @"{RIGHT}"; -NSString *const kMPAutotypeCommandDelete = @"{DELETE}"; -NSString *const kMPAutotypeCommandHome = @"{HOME}"; -NSString *const kMPAutotypeCommandEnd = @"{END}"; -NSString *const kMPAutotypeCommandPageUp = @"{PGUP}"; -NSString *const kMPAutotypeCommandPageDown = @"{PGDOWN}"; -NSString *const kMPAutotypeCommandBackspace = @"{BACKSPACE}"; -NSString *const kMPAutotypeCommandBackspaceShort = @"{BS}"; -NSString *const kMPAutotypeCommandBackspaceMedium = @"{BKSP}"; -NSString *const kMPAutotypeCommandBreak = @"{BREAK}"; -NSString *const kMPAutotypeCommandCapsLock = @"{CAPSLOCK}"; -NSString *const kMPAutotypeCommandEscape = @"{ESC}"; -NSString *const kMPAutotypeCommandWindows = @"{WIN}"; -NSString *const kMPAutotypeCommandLeftWindows = @"{LWIN}"; -NSString *const kMPAutotypeCommandRightWindows = @"{RWIN}"; -NSString *const kMPAutotypeCommandApps = @"{APPS}"; -NSString *const kMPAutotypeCommandHelp = @"{HELP}"; -NSString *const kMPAutotypeCommandNumlock = @"{NUMLOCK}"; -NSString *const kMPAutotypeCommandPrintScreen = @"{PRTSC}"; -NSString *const kMPAutotypeCommandScrollLock = @"{SCROLLLOCK}"; -NSString *const kMPAutotypeCommandF1 = @"{F1}"; -/* - Tab {TAB} - Enter {ENTER} or ~ - Arrow Up {UP} - Arrow Down {DOWN} - Arrow Left {LEFT} - Arrow Right {RIGHT} - Insert {INSERT} or {INS} - Delete {DELETE} or {DEL} - - Home {HOME} - End {END} - Page Up {PGUP} - Page Down {PGDN} - Backspace {BACKSPACE}, {BS} or {BKSP} - Break {BREAK} - Caps-Lock {CAPSLOCK} - Escape {ESC} - Windows Key {WIN} (equ. to {LWIN}) - Windows Key: left, right {LWIN}, {RWIN} - Apps / Menu {APPS} - Help {HELP} - Numlock {NUMLOCK} - Print Screen {PRTSC} - Scroll Lock {SCROLLLOCK} - F1 - F16 {F1} - {F16} - Numeric Keypad + {ADD} - Numeric Keypad - {SUBTRACT} - Numeric Keypad * {MULTIPLY} - Numeric Keypad / {DIVIDE} - Numeric Keypad 0 to 9 {NUMPAD0} to {NUMPAD9} - Shift + - Ctrl ^ - Alt % - + {+} - ^ {^} - % {%} - ~ {~} - (, ) {(}, {)} - [, ] {[}, {]} - {, } {{}, {}} - */ - @implementation MPAutotypeCommand - (void)sendPressKey:(CGKeyCode)keyCode modifierFlags:(CGEventFlags)flags { diff --git a/MacPass/MPAutotypeParser.m b/MacPass/MPAutotypeParser.m index d24e9986..66c1f8ea 100644 --- a/MacPass/MPAutotypeParser.m +++ b/MacPass/MPAutotypeParser.m @@ -7,57 +7,11 @@ // #import "MPAutotypeParser.h" -#import "MPAutotypeCommand.h" + +#import "KPKAutotypeCommands.h" @implementation MPAutotypeParser -/* - Tab {TAB} - Enter {ENTER} or ~ - Arrow Up {UP} - Arrow Down {DOWN} - Arrow Left {LEFT} - Arrow Right {RIGHT} - Insert {INSERT} or {INS} - Delete {DELETE} or {DEL} - Home {HOME} - End {END} - Page Up {PGUP} - Page Down {PGDN} - Backspace {BACKSPACE}, {BS} or {BKSP} - Break {BREAK} - Caps-Lock {CAPSLOCK} - Escape {ESC} - Windows Key {WIN} (equ. to {LWIN}) - Windows Key: left, right {LWIN}, {RWIN} - Apps / Menu {APPS} - Help {HELP} - Numlock {NUMLOCK} - Print Screen {PRTSC} - Scroll Lock {SCROLLLOCK} - F1 - F16 {F1} - {F16} - Numeric Keypad + {ADD} - Numeric Keypad - {SUBTRACT} - Numeric Keypad * {MULTIPLY} - Numeric Keypad / {DIVIDE} - Numeric Keypad 0 to 9 {NUMPAD0} to {NUMPAD9} - Shift + - Ctrl ^ - Alt % - + {+} - ^ {^} - % {%} - ~ {~} - (, ) {(}, {)} - [, ] {[}, {]} - {, } {{}, {}} - - special commands: - - {DELAY X} Delays X milliseconds. - {CLEARFIELD} Clears the contents of the edit control that currently has the focus (only single-line edit controls). - {VKEY X} - */ + (NSArray *)commandsForCommandString:(NSString *)commands { NSUInteger commandIndex = 0; CGEventFlags modiferKeys = 0; @@ -72,13 +26,13 @@ NSRange modifierRange = [currentCommands rangeOfCharacterFromSet:modifierKeySet options:NSCaseInsensitiveSearch range:NSMakeRange(0, 1)]; if(modifierRange.length != 0 && modifierRange.location == 0) { /* starts with a special key */ - if([currentCommands hasPrefix:kMPAutotypeSymbolShift]) { + if([currentCommands hasPrefix:kMPAutotypeShortShift]) { modiferKeys |= kCGEventFlagMaskAlphaShift; } - if([currentCommands hasPrefix:kMPAutotypeSymbolControl]) { + if([currentCommands hasPrefix:kMPAutotypeShortControl]) { modiferKeys |= kCGEventFlagMaskControl; } - if([currentCommands hasPrefix:kMPAutotypeSymbolAlt]) { + if([currentCommands hasPrefix:kMPAutotypeShortAlt]) { modiferKeys = kCGEventFlagMaskAlternate; } /* move the index and continue */ @@ -147,7 +101,7 @@ + (NSString *)_normalizeCommands:(NSString *)commandString { /* Cache normalized Commands? */ NSMutableString *mutableCommand = [commandString mutableCopy]; - [mutableCommand replaceOccurrencesOfString:kMPAutotypeSymbolEnter withString:kMPAutptypeCommandEnter options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableCommand length])]; + [mutableCommand replaceOccurrencesOfString:kMPAutotypeShortEnter withString:kMPAutotypeEnter options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableCommand length])]; [mutableCommand replaceOccurrencesOfString:@"{{}" withString:@"{LCURL}" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableCommand length])]; [mutableCommand replaceOccurrencesOfString:@"{}}" withString:@"{RCURL}" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableCommand length])]; return nil; diff --git a/MacPass/MacPass-Prefix.pch b/MacPass/MacPass-Prefix.pch index ef5ac8ee..d3edb1a5 100644 --- a/MacPass/MacPass-Prefix.pch +++ b/MacPass/MacPass-Prefix.pch @@ -4,4 +4,5 @@ #ifdef __OBJC__ #import +//#import "KPKAutotypeCommands.h" #endif diff --git a/MacPassTests/KPKHashedDataTest.m b/MacPassTests/KPKHashedDataTest.m index 4c174d72..c44be6af 100644 --- a/MacPassTests/KPKHashedDataTest.m +++ b/MacPassTests/KPKHashedDataTest.m @@ -6,10 +6,15 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKHashedDataTest.h" +#import + #import "NSData+HashedData.h" #import "NSData+Random.h" +@interface KPKHashedDataTest : XCTestCase + +@end + @implementation KPKHashedDataTest - (void)testHashedData { @@ -17,7 +22,7 @@ NSData *data = [NSData dataWithRandomBytes:10000]; NSData *hashedData = [data hashedDataWithBlockSize:512]; NSData *unhashedData = [hashedData unhashedData]; - STAssertTrue([unhashedData isEqualToData:data], @"Data needs to be the same after hashing and unhashing"); + XCTAssertTrue([unhashedData isEqualToData:data], @"Data needs to be the same after hashing and unhashing"); } @end diff --git a/MacPassTests/KPKIconLoading.m b/MacPassTests/KPKIconLoading.m index 9e84dbb0..87424e1f 100644 --- a/MacPassTests/KPKIconLoading.m +++ b/MacPassTests/KPKIconLoading.m @@ -6,9 +6,16 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKIconLoading.h" +#import + #import "KPKIcon.h" +@interface KPKIconLoading : XCTestCase { + NSImage *_image; + NSData *_imageData; +} +@end + @implementation KPKIconLoading - (void)setUp { @@ -26,17 +33,17 @@ NSBundle *myBundle = [NSBundle bundleForClass:[self class]]; NSURL *imageURL = [myBundle URLForImageResource:@"image.png"]; KPKIcon *icon = [[KPKIcon alloc] initWithImageAtURL:imageURL]; - STAssertNotNil(icon, @"Icon should have been loaded"); + XCTAssertNotNil(icon, @"Icon should have been loaded"); NSString *iconString = [icon encodedString]; KPKIcon *iconFromString = [[KPKIcon alloc] initWithUUID:[NSUUID UUID] encodedString:iconString]; - STAssertTrue([iconString isEqualToString:[iconFromString encodedString]], @"Encoding and Decoding should result in the same string"); + XCTAssertTrue([iconString isEqualToString:[iconFromString encodedString]], @"Encoding and Decoding should result in the same string"); Class repClass = [NSBitmapImageRep class]; NSImageRep *imageRep = [[icon.image representations] lastObject]; - STAssertNotNil(imageRep, @"One image rep shoudl be there"); - STAssertTrue([imageRep isKindOfClass:repClass], @"Representation should be bitmap"); + XCTAssertNotNil(imageRep, @"One image rep shoudl be there"); + XCTAssertTrue([imageRep isKindOfClass:repClass], @"Representation should be bitmap"); NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)imageRep; NSData *pngData = [bitmapRep representationUsingType:NSPNGFileType properties:nil]; - STAssertTrue([pngData isEqualToData:_imageData], @"Image and PNG data shoudl be identical"); + XCTAssertTrue([pngData isEqualToData:_imageData], @"Image and PNG data shoudl be identical"); } diff --git a/MacPassTests/KPKTestHexColor.m b/MacPassTests/KPKTestHexColor.m index 09884773..9a47979c 100644 --- a/MacPassTests/KPKTestHexColor.m +++ b/MacPassTests/KPKTestHexColor.m @@ -6,10 +6,15 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestHexColor.h" +#import #import "NSColor+KeePassKit.h" + +@interface KPKTestHexColor : XCTestCase + +@end + @implementation KPKTestHexColor - (void)testHexToColor { @@ -21,26 +26,26 @@ NSColor *green = [NSColor colorWithHexString:greeHex]; NSColor *blue = [NSColor colorWithHexString:blueHex]; - STAssertEquals([red redComponent], 1.0, @"Red color should have 100% red"); - STAssertEquals([red blueComponent], 0.0, @"Red color should have 0% blue"); - STAssertEquals([red greenComponent], 0.0, @"Red color should have 0% green"); + XCTAssertEqual([red redComponent], 1.0, @"Red color should have 100%% red"); + XCTAssertEqual([red blueComponent], 0.0, @"Red color should have 0%% blue"); + XCTAssertEqual([red greenComponent], 0.0, @"Red color should have 0%% green"); - STAssertEquals([green redComponent], 0.0, @"Green color should have 0% red"); - STAssertEquals([green greenComponent], 1.0, @"Green color should have 100% green"); - STAssertEquals([green blueComponent], 0.0, @"Green color should have 0% blue"); + XCTAssertEqual([green redComponent], 0.0, @"Green color should have 0%% red"); + XCTAssertEqual([green greenComponent], 1.0, @"Green color should have 100%% green"); + XCTAssertEqual([green blueComponent], 0.0, @"Green color should have 0%% blue"); - STAssertEquals([blue redComponent], 0.0, @"Blue color should have 0% red"); - STAssertEquals([blue greenComponent], 0.0, @"Blue color should have 0% green"); - STAssertEquals([blue blueComponent], 1.0, @"Blue color should have 100% blue"); + XCTAssertEqual([blue redComponent], 0.0, @"Blue color should have 0%% red"); + XCTAssertEqual([blue greenComponent], 0.0, @"Blue color should have 0%% green"); + XCTAssertEqual([blue blueComponent], 1.0, @"Blue color should have 100%% blue"); } - (void)testColorRefReading { uint32_t colorBytes = 0x000000FF; NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:3 freeWhenDone:NO]; NSColor *color = [NSColor colorWithData:colorData]; - STAssertEquals([color redComponent], 1.0, @"Red 100%"); - STAssertEquals([color greenComponent], 0.0, @"Green 0%"); - STAssertEquals([color blueComponent], 0.0, @"Blue 100%"); + XCTAssertEqual([color redComponent], 1.0, @"Red 100%%"); + XCTAssertEqual([color greenComponent], 0.0, @"Green 0%%"); + XCTAssertEqual([color blueComponent], 0.0, @"Blue 100%%"); } - (void)testColorRefWriting { @@ -48,7 +53,7 @@ NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:4 freeWhenDone:NO]; NSColor *color = [NSColor colorWithData:colorData]; NSData *newData = [color colorData]; - STAssertEqualObjects(colorData, newData, @"Convertion should result in same data"); + XCTAssertEqualObjects(colorData, newData, @"Convertion should result in same data"); } @end diff --git a/MacPassTests/KPKTestKeyfileParsing.m b/MacPassTests/KPKTestKeyfileParsing.m index 93a67a93..79ddbeb5 100644 --- a/MacPassTests/KPKTestKeyfileParsing.m +++ b/MacPassTests/KPKTestKeyfileParsing.m @@ -6,9 +6,13 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestKeyfileParsing.h" +#import #import "NSData+Keyfile.h" +@interface KPKTestKeyfileParsing : XCTestCase + +@end + @implementation KPKTestKeyfileParsing - (void)testXmlKeyfileLoadingValidFile { @@ -16,32 +20,32 @@ NSURL *url = [myBundle URLForResource:@"Keepass2Key" withExtension:@"xml"]; NSError *error; NSData *data = [NSData dataWithContentsOfKeyFile:url version:KPKXmlVersion error:&error]; - STAssertNotNil(data, @"Data should be loaded"); - STAssertNil(error, @"No error should occur on keyfile loading"); + XCTAssertNotNil(data, @"Data should be loaded"); + XCTAssertNil(error, @"No error should occur on keyfile loading"); } - (void)testXmlKeyfileLoadingCorruptData { - STAssertFalse(NO, @"Not Implemented"); + XCTAssertFalse(NO, @"Not Implemented"); } - (void)testXmlKeyfileLoadingMissingVersion { - STAssertFalse(NO, @"Not Implemented"); + XCTAssertFalse(NO, @"Not Implemented"); } - (void)testXmlKeyfileLoadingLowerVersion { - STAssertFalse(NO, @"Not Implemented"); + XCTAssertFalse(NO, @"Not Implemented"); } - (void)testXmlKeyfilGeneration { NSData *data = [NSData generateKeyfiledataForVersion:KPKXmlVersion]; // Test if structure is sound; - STAssertNotNil(data, @"Keydata should have been generated"); + XCTAssertNotNil(data, @"Keydata should have been generated"); } - (void)testLegacyKeyfileGeneration { NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion]; // test if strucutre is sound; - STAssertNotNil(data, @"Keydata should have been generated"); + XCTAssertNotNil(data, @"Keydata should have been generated"); } @end diff --git a/MacPassTests/KPKTestLegacyLoading.m b/MacPassTests/KPKTestLegacyLoading.m index 972c1803..f57b82b3 100644 --- a/MacPassTests/KPKTestLegacyLoading.m +++ b/MacPassTests/KPKTestLegacyLoading.m @@ -6,7 +6,8 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestLegacyLoading.h" + +#import #import "KPKTree+Serializing.h" #import "KPKCompositeKey.h" @@ -15,13 +16,17 @@ #import "KPKErrors.h" +@interface KPKTestLegacyLoading : XCTestCase + +@end + @implementation KPKTestLegacyLoading - (void)testValidFile { KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"1234" key:nil]; NSData *data = [self _loadTestDataBase:@"Test_Password_1234" extension:@"kdb"]; KPKTree *tree = [[KPKTree alloc] initWithData:data password:password error:NULL]; - STAssertNotNil(tree, @"Loading should result in a tree object"); + XCTAssertNotNil(tree, @"Loading should result in a tree object"); } - (void)testWrongPassword { @@ -29,8 +34,8 @@ NSData *data = [self _loadTestDataBase:@"KeePass1_native_test" extension:@"kdb"]; NSError *error; KPKTree *tree = [[KPKTree alloc] initWithData:data password:password error:&error]; - STAssertNil(tree, @"Wrong password should yield nil tree"); - STAssertNotNil(error, @"Wrong password should yield error"); + XCTAssertNil(tree, @"Wrong password should yield nil tree"); + XCTAssertNotNil(error, @"Wrong password should yield error"); //STAssertTrue([error code] == KPKErrorPasswordAndOrKeyfileWrong, @"Error code should be wrong password and/or keyfile"); } @@ -39,9 +44,9 @@ uint8_t bytes[] = {0x00,0x11,0x22,0x33,0x44}; NSData *data = [NSData dataWithBytes:bytes length:5]; KPKTree *tree = [[KPKTree alloc] initWithData:data password:nil error:&error]; - STAssertNil(tree, @"Tree should be nil with invalid data"); - STAssertNotNil(error, @"Error object should have been created"); - STAssertTrue(KPKErrorUnknownFileFormat == [error code], @"Error should be Unknown file format"); + XCTAssertNil(tree, @"Tree should be nil with invalid data"); + XCTAssertNotNil(error, @"Error object should have been created"); + XCTAssertTrue(KPKErrorUnknownFileFormat == [error code], @"Error should be Unknown file format"); } @@ -49,10 +54,10 @@ NSData *data = [self _loadTestDataBase:@"KDB1_KeePassX_test" extension:@"kdb"]; KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"test" key:nil]; KPKTree *tree = [[KPKTree alloc] initWithData:data password:password error:NULL]; - STAssertNotNil(tree, @"Tree shoudl be loaded" ); + XCTAssertNotNil(tree, @"Tree shoudl be loaded" ); KPKIcon *icon = [tree.metaData.customIcons lastObject]; - STAssertNotNil(icon, @"Should load one Icon"); + XCTAssertNotNil(icon, @"Should load one Icon"); } - (NSData *)_loadTestDataBase:(NSString *)name extension:(NSString *)extension { diff --git a/MacPassTests/KPKTestLegacyWriting.m b/MacPassTests/KPKTestLegacyWriting.m index d20f5d1f..79af2f2f 100644 --- a/MacPassTests/KPKTestLegacyWriting.m +++ b/MacPassTests/KPKTestLegacyWriting.m @@ -6,11 +6,15 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestLegacyWriting.h" +#import #import "KPKCompositeKey.h" #import "KPKTree+Serializing.h" +@interface KPKTestLegacyWriting : XCTestCase + +@end + @implementation KPKTestLegacyWriting - (void)testWriting { @@ -18,15 +22,15 @@ NSURL *dbUrl = [self _urlForFile:@"CustomIcon_Password_1234" extension:@"kdbx"]; KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"1234" key:nil]; KPKTree *tree = [[KPKTree alloc] initWithContentsOfUrl:dbUrl password:password error:&error]; - STAssertNotNil(tree, @"Tree should be created"); + XCTAssertNotNil(tree, @"Tree should be created"); error = nil; NSData *data = [tree encryptWithPassword:password forVersion:KPKLegacyVersion error:&error]; - STAssertNotNil(data, @"Serialized Data shoudl be created"); + XCTAssertNotNil(data, @"Serialized Data shoudl be created"); NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234.kdb"]; NSLog(@"Saved to %@", tempFile); [data writeToFile:tempFile atomically:YES]; KPKTree *loadTree = [[KPKTree alloc] initWithData:data password:password error:&error]; - STAssertNotNil(loadTree, @"Tree should be loadable from kdb file data"); + XCTAssertNotNil(loadTree, @"Tree should be loadable from kdb file data"); } - (NSData *)_dataForFile:(NSString *)name extension:(NSString *)extension { diff --git a/MacPassTests/KPKTestNSCoding.m b/MacPassTests/KPKTestNSCoding.m index c18fd7e2..da45bf83 100644 --- a/MacPassTests/KPKTestNSCoding.m +++ b/MacPassTests/KPKTestNSCoding.m @@ -6,12 +6,17 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestNSCoding.h" + +#import #import "KPKEntry.h" #import "KPKBinary.h" #import "KPKAttribute.h" #import "KPKXmlElements.h" +@interface KPKTestNSCoding : XCTestCase + +@end + @implementation KPKTestNSCoding - (void)testAttributeCoding { @@ -19,13 +24,13 @@ NSData *data = [self encode:attribute]; KPKAttribute *copy = [self decode:data ofClass:[KPKAttribute class]]; - STAssertTrue([copy.value isEqualToString:attribute.value], @"Values should be preseved"); - STAssertTrue([copy.key isEqualToString:attribute.key], @"Keys should be preserved"); - STAssertTrue(copy.isProtected == attribute.isProtected, @"Protected status should be the same"); + XCTAssertTrue([copy.value isEqualToString:attribute.value], @"Values should be preseved"); + XCTAssertTrue([copy.key isEqualToString:attribute.key], @"Keys should be preserved"); + XCTAssertTrue(copy.isProtected == attribute.isProtected, @"Protected status should be the same"); } - (void)testBinaryCoding { - + XCTFail(@"Not Tested"); } - (void)testEntryCoding { @@ -49,19 +54,19 @@ NSData *encodedData = [self encode:entry]; KPKEntry *copyEntry = [self decode:encodedData ofClass:[KPKEntry class]]; - STAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); - STAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match"); - STAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match"); - STAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); + XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); + XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match"); + XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match"); + XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); KPKBinary *copiedBinary = [copyEntry.binaries lastObject]; - STAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); - STAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); + XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); + XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); } - (void)testGroupCoding { - + XCTFail(@"Not Implemented"); } diff --git a/MacPassTests/KPKTestNSCopying.m b/MacPassTests/KPKTestNSCopying.m index 9bea9cf1..748d9fd3 100644 --- a/MacPassTests/KPKTestNSCopying.m +++ b/MacPassTests/KPKTestNSCopying.m @@ -6,11 +6,14 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestNSCopying.h" +#import #import "KPKEntry.h" #import "KPKAttribute.h" #import "KPKBinary.h" +@interface KPKTestNSCopying : XCTestCase + +@end @implementation KPKTestNSCopying @@ -22,10 +25,10 @@ attribute.value = @"NewValue"; attribute.isProtected = YES; - STAssertNotNil(copy, @"Copy shoule exist"); - STAssertTrue([copy.key isEqualToString:@"Key"], @"Copy key should be key"); - STAssertTrue([copy.value isEqualToString:@"Value"], @"Copy value should be value"); - STAssertFalse(copy.isProtected, @"Copy should not be protected"); + XCTAssertNotNil(copy, @"Copy shoule exist"); + XCTAssertTrue([copy.key isEqualToString:@"Key"], @"Copy key should be key"); + XCTAssertTrue([copy.value isEqualToString:@"Value"], @"Copy value should be value"); + XCTAssertFalse(copy.isProtected, @"Copy should not be protected"); } - (void)testEntryCopying { @@ -52,14 +55,14 @@ [entry removeBinary:binary]; [[entry.customAttributes lastObject] setKey:@"NewCustomKey"]; - STAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); - STAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match"); - STAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match"); - STAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); + XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil"); + XCTAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match"); + XCTAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match"); + XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied"); KPKBinary *copiedBinary = [copyEntry.binaries lastObject]; - STAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); - STAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); + XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match"); + XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht"); } @end diff --git a/MacPassTests/KPKTestPlaceholder.m b/MacPassTests/KPKTestPlaceholder.m index 5af242f0..caec37cb 100644 --- a/MacPassTests/KPKTestPlaceholder.m +++ b/MacPassTests/KPKTestPlaceholder.m @@ -6,12 +6,17 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestPlaceholder.h" +#import #import "KPKEntry.h" #import "KPKAttribute.h" #import "NSString+Commands.h" + +@interface KPKTextPlaceholder : XCTestCase + +@end + @implementation KPKTextPlaceholder - (void)testPlaceholder { @@ -25,10 +30,9 @@ [entry addCustomAttribute:attribute]; NSString *placeholder = @"{USERNAME}{PASSWORD}{NOTHING}{URL}{S:extended}"; - BOOL replaced; - NSString *evaluated = [placeholder evaluatePlaceholderWithEntry:entry didReplace:&replaced]; - //NSString *evaluatedGoal = [NSString stringWithFormat:@"%@%@{NOTHING}%@%@", entry.username, entry.password, entry.url, attribute.value]; - //STAssertTrue([evaluated isEqualToString:evaluatedGoal], @"Evaluated string must match"); + NSString *evaluated = [placeholder evaluatePlaceholderWithEntry:entry]; + NSString *evaluatedGoal = [NSString stringWithFormat:@"%@%@{NOTHING}%@%@", entry.username, entry.password, entry.url, attribute.value]; + XCTAssertTrue([evaluated isEqualToString:evaluatedGoal], @"Evaluated string must match"); } @end diff --git a/MacPassTests/KPKTestReference.m b/MacPassTests/KPKTestReference.m index b1cb91c6..d68d5b23 100644 --- a/MacPassTests/KPKTestReference.m +++ b/MacPassTests/KPKTestReference.m @@ -14,21 +14,9 @@ @implementation KPKTestReference -- (void)setUp -{ - [super setUp]; - // Put setup code here. This method is called before the invocation of each test method in the class. -} - -- (void)tearDown -{ - // Put teardown code here. This method is called after the invocation of each test method in the class. - [super tearDown]; -} - - (void)testExample { - XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); + } @end diff --git a/MacPassTests/KPKTestXmlLoading.m b/MacPassTests/KPKTestXmlLoading.m index a1682bcf..e65bade4 100644 --- a/MacPassTests/KPKTestXmlLoading.m +++ b/MacPassTests/KPKTestXmlLoading.m @@ -6,13 +6,23 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestXmlLoading.h" -#import "KPKCompositeKey.h" +#import +#import "KPKCompositeKey.h" #import "KPKTree+Serializing.h" #import "KPKEntry.h" #import "KPKGroup.h" + +@interface KPKTestXmlLoading : XCTestCase { +@private + NSData *_data; + KPKCompositeKey *_password; +} + +@end + + @implementation KPKTestXmlLoading - (void)setUp { @@ -30,10 +40,10 @@ - (void)testLoading { NSError *error; KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:&error]; - STAssertNotNil(tree, @"Loading should result in a tree object"); + XCTAssertNotNil(tree, @"Loading should result in a tree object"); - STAssertTrue([tree.root.groups count] == 0, @"Tree contains just root group"); - STAssertTrue([tree.root.entries count] == 1, @"Tree has only one entry"); + XCTAssertTrue([tree.root.groups count] == 0, @"Tree contains just root group"); + XCTAssertTrue([tree.root.entries count] == 1, @"Tree has only one entry"); } - (void)testAutotypeLoading { @@ -42,9 +52,9 @@ KPKCompositeKey *password = [[KPKCompositeKey alloc] initWithPassword:@"test" key:nil]; NSError *error; KPKTree *tree = [[KPKTree alloc] initWithContentsOfUrl:url password:password error:&error]; - STAssertNotNil(tree, @"Tree shoud be loaded"); + XCTAssertNotNil(tree, @"Tree shoud be loaded"); KPKEntry *entry = tree.root.entries[0]; - STAssertNotNil(entry, @"Entry should be there"); + XCTAssertNotNil(entry, @"Entry should be there"); } @end diff --git a/MacPassTests/KPKTestXmlParsing.m b/MacPassTests/KPKTestXmlParsing.m index 8b01a41d..96d0fbd1 100644 --- a/MacPassTests/KPKTestXmlParsing.m +++ b/MacPassTests/KPKTestXmlParsing.m @@ -6,12 +6,18 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestXmlParsing.h" + +#import + #import "KPKXmlTreeReader.h" #import "KPKErrors.h" #import "DDXMLDocument.h" +@interface KPKTestXmlParsing : XCTestCase + +@end + @implementation KPKTestXmlParsing - (void)testEmptyXmlFile { @@ -19,9 +25,9 @@ KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; NSError *error; KPKTree *tree = [reader tree:&error]; - STAssertNil(tree, @"No Tree form emptry data"); - STAssertNotNil(error, @"Error Object should be provided"); - STAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data"); + XCTAssertNil(tree, @"No Tree form emptry data"); + XCTAssertNotNil(error, @"Error Object should be provided"); + XCTAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data"); } - (void)testNoNodeXmlFile { @@ -29,9 +35,9 @@ KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; NSError *error; KPKTree *tree = [reader tree:&error]; - STAssertNil(tree, @"No Tree form emptry data"); - STAssertNotNil(error, @"Error Object should be provided"); - STAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing"); + XCTAssertNil(tree, @"No Tree form emptry data"); + XCTAssertNotNil(error, @"Error Object should be provided"); + XCTAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing"); } - (void)testNoRoodXmlFil { @@ -39,9 +45,9 @@ KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil]; NSError *error; KPKTree *tree = [reader tree:&error]; - STAssertNil(tree, @"No Tree form emptry data"); - STAssertNotNil(error, @"Error Object should be provided"); - STAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing"); + XCTAssertNil(tree, @"No Tree form emptry data"); + XCTAssertNotNil(error, @"Error Object should be provided"); + XCTAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing"); } @end diff --git a/MacPassTests/KPKTestXmlWriting.m b/MacPassTests/KPKTestXmlWriting.m index d0146c8e..b111af6b 100644 --- a/MacPassTests/KPKTestXmlWriting.m +++ b/MacPassTests/KPKTestXmlWriting.m @@ -6,10 +6,15 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "KPKTestXmlWriting.h" +#import #import "KPKCompositeKey.h" #import "KPKTree+Serializing.h" +@interface KPKTestXmlWriting : XCTestCase + +@end + + @implementation KPKTestXmlWriting - (void)testXmlWriting { @@ -19,7 +24,7 @@ KPKTree *tree = [[KPKTree alloc] initWithData:data password:password error:&error]; error = nil; NSData *saveData = [tree encryptWithPassword:password forVersion:KPKXmlVersion error:&error]; - STAssertNotNil(saveData, @"Serialization should yield data"); + XCTAssertNotNil(saveData, @"Serialization should yield data"); NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234_save.kdbx"]; NSLog(@"Saved file to %@", tempFile); [saveData writeToFile:tempFile atomically:YES]; @@ -27,7 +32,7 @@ error = nil; NSURL *url = [NSURL fileURLWithPath:tempFile]; KPKTree *reloadedTree = [[KPKTree alloc] initWithContentsOfUrl:url password:password error:&error]; - STAssertNotNil(reloadedTree, @"Reloaded tree should not be nil"); + XCTAssertNotNil(reloadedTree, @"Reloaded tree should not be nil"); } - (NSData *)_loadTestDataBase:(NSString *)name extension:(NSString *)extension { diff --git a/MacPassTests/MPDatabaseCreation.m b/MacPassTests/MPDatabaseCreation.m index 9fc022c1..ce8b5b59 100644 --- a/MacPassTests/MPDatabaseCreation.m +++ b/MacPassTests/MPDatabaseCreation.m @@ -6,19 +6,24 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "MPDatabaseCreation.h" +#import + #import "MPDocument.h" #import "KPKTree.h" #import "KPKCompositeKey.h" +@interface MPDatabaseCreation : XCTestCase + +@end + @implementation MPDatabaseCreation - (void)testCreateNewDatabase { MPDocument *document = [[MPDocument alloc] init]; - STAssertNotNil(document, @"Document should be created"); - STAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in defautl case"); - STAssertFalse(document.encrypted, @"Document cannot be encrypted at creation"); - STAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured"); + XCTAssertNotNil(document, @"Document should be created"); + XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in defautl case"); + XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation"); + XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured"); } @end diff --git a/MacPassTests/MPDatabaseLoading.m b/MacPassTests/MPDatabaseLoading.m index a561b806..ac6c4278 100644 --- a/MacPassTests/MPDatabaseLoading.m +++ b/MacPassTests/MPDatabaseLoading.m @@ -6,12 +6,15 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "MPDatabaseLoading.h" +#import #import "MPDocument.h" - #import "KPKTree.h" +@interface MPDatabaseLoading : XCTestCase + +@end + @implementation MPDatabaseLoading @@ -20,12 +23,12 @@ NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdb"]; NSError *error = nil; MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdb" error:&error]; - STAssertNil(error, @"No Error should occur on loading"); - STAssertNotNil(document, @"Document cannot be nil"); - STAssertTrue(document.encrypted, @"Loaded but unencrypted should be not decrypted"); - STAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil error:&error], @"Should decrypt with password"); - STAssertNil(error, @"No Error should occur on unlocking with correct password"); - STAssertTrue((document.tree.minimumVersion = KPKLegacyVersion), @"Minimal Version should not increase with KDB File loaded"); + XCTAssertNil(error, @"No Error should occur on loading"); + XCTAssertNotNil(document, @"Document cannot be nil"); + XCTAssertTrue(document.encrypted, @"Loaded but unencrypted should be not decrypted"); + XCTAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil error:&error], @"Should decrypt with password"); + XCTAssertNil(error, @"No Error should occur on unlocking with correct password"); + XCTAssertTrue((document.tree.minimumVersion = KPKLegacyVersion), @"Minimal Version should not increase with KDB File loaded"); //STAssertTrue([document.fileType isEqualToString:[MPDocument fileTypeForVersion:KPKLegacyVersion]], @"File type needs to match opened file"); } @@ -34,11 +37,11 @@ NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdb"]; NSError *error = nil; MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdb" error:&error]; - STAssertNil(error, @"No Error should occur on loading"); - STAssertNotNil(document, @"Document should not be nil"); - STAssertTrue(document.encrypted, @"Loaded but unencrypted should be not decrypted"); - STAssertFalse([document unlockWithPassword:@"123" keyFileURL:nil error:&error], @"Decryption should fail"); - STAssertNotNil(error, @"Error should occur on unlocking with correct password"); + XCTAssertNil(error, @"No Error should occur on loading"); + XCTAssertNotNil(document, @"Document should not be nil"); + XCTAssertTrue(document.encrypted, @"Loaded but unencrypted should be not decrypted"); + XCTAssertFalse([document unlockWithPassword:@"123" keyFileURL:nil error:&error], @"Decryption should fail"); + XCTAssertNotNil(error, @"Error should occur on unlocking with correct password"); } - (void)testLoadDatabaseVerions2 { @@ -46,8 +49,8 @@ NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdbx"]; NSError *error = nil; MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdbx" error:&error]; - STAssertNil(error, @"No Error should occur on loading"); - STAssertNotNil(document, @"Document cannot be nil"); + XCTAssertNil(error, @"No Error should occur on loading"); + XCTAssertNotNil(document, @"Document cannot be nil"); /* STAssertFalse(document.decrypted, @"Document is not decrypted after inital load"); STAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil], @"Should decrypt with password"); diff --git a/MacPassTests/MPDatabasePasswordAndKeyfile.m b/MacPassTests/MPDatabasePasswordAndKeyfile.m index 982d5fe2..81e64312 100644 --- a/MacPassTests/MPDatabasePasswordAndKeyfile.m +++ b/MacPassTests/MPDatabasePasswordAndKeyfile.m @@ -6,11 +6,17 @@ // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // -#import "MPDatabasePasswordAndKeyfile.h" + +#import #import "MPDocument.h" #import "KPKCompositeKey.h" +@interface MPDatabasePasswordAndKeyfile : XCTestCase { + MPDocument *_database; +} +@end + @implementation MPDatabasePasswordAndKeyfile - (void)setUp { @@ -22,9 +28,9 @@ } - (void)testSetPassword { - STAssertNil(_database.compositeKey, @"New database should not have a composite key"); - STAssertTrue([_database changePassword:@"password" keyFileURL:nil], @"Setting the Password should succeed"); - STAssertFalse([_database changePassword:nil keyFileURL:nil], @"resetting the password and key to nil should not work"); + XCTAssertNil(_database.compositeKey, @"New database should not have a composite key"); + XCTAssertTrue([_database changePassword:@"password" keyFileURL:nil], @"Setting the Password should succeed"); + XCTAssertFalse([_database changePassword:nil keyFileURL:nil], @"resetting the password and key to nil should not work"); } - (void)testSetKeyfile {/*