Refactored the selection tracking to be in the document now

Filtering should work reliably now. No "sticking" of entries
Fixed #42. Deleted entries now result in desolation.
This commit is contained in:
michael starke
2013-07-24 01:05:49 +02:00
parent 8087085fc0
commit 4a35d0d4ff
29 changed files with 1713 additions and 1444 deletions

View File

@@ -10,7 +10,7 @@
@class KPKPassword;
@interface KPKTreeLoadingTest : SenTestCase {
@interface KPKLegacyLoadingTest : SenTestCase {
@private
NSData *_data;
KPKPassword *_password;

View File

@@ -6,15 +6,15 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTreeLoadingTest.h"
#import "KPKLegacyLoadingTest.h"
#import "KPKTreeCryptor.h"
#import "KPKPassword.h"
@implementation KPKTreeLoadingTest
@implementation KPKLegacyLoadingTest
- (void)setUp {
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdbx"];
NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdb"];
_data = [NSData dataWithContentsOfURL:url];
_password = [[KPKPassword alloc] initWithPassword:@"1234" key:nil];
}

View File

@@ -0,0 +1,18 @@
//
// KPKXmlLoadingTest.h
// MacPass
//
// Created by Michael Starke on 23.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <SenTestingKit/SenTestingKit.h>
@class KPKPassword;
@interface KPKXmlLoadingTest : SenTestCase {
@private
NSData *_data;
KPKPassword *_password;
}
@end

View File

@@ -0,0 +1,33 @@
//
// KPKXmlLoadingTest.m
// MacPass
//
// Created by Michael Starke on 23.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKXmlLoadingTest.h"
#import "KPKTreeCryptor.h"
#import "KPKPassword.h"
@implementation KPKXmlLoadingTest
- (void)setUp {
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSURL *url = [myBundle URLForResource:@"Test_Password_1234" withExtension:@"kdbx"];
_data = [NSData dataWithContentsOfURL:url];
_password = [[KPKPassword alloc] initWithPassword:@"1234" key:nil];
}
- (void)tearDown {
_data = nil;
_password = nil;
}
- (void)testLoading {
KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_data password:_password];
KPKTree *tree = [cryptor decryptTree:NULL];
STAssertNotNil(tree, @"Loading should result in a tree object");
}
@end