~ubuntuone-ios-client-team/ubuntuone-ios-files/trunk

« back to all changes in this revision

Viewing changes to FilesTests/U1HasherTest.m

  • Committer: Tarmac
  • Author(s): mike.mccracken@canonical.com
  • Date: 2013-05-29 18:52:51 UTC
  • mfrom: (100.6.7 2selfish-hasher)
  • Revision ID: tarmac-20130529185251-pxoj6kkqx80qeig5
- change to allow concurrent hashers

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
}
110
110
 
111
111
- (void)testSynchronouslyGetHashes{
112
 
        U1Hasher *sharedHasher = [U1Hasher sharedHasher];
113
 
        sharedHasher.assetsLibrary = (ALAssetsLibrary *)[[[OneAssetFakeAssetsLibrary alloc] init] autorelease];
 
112
        U1Hasher *hasher = [[[U1Hasher alloc] init] autorelease];
 
113
        hasher.assetsLibrary = (ALAssetsLibrary *)[[[OneAssetFakeAssetsLibrary alloc] init] autorelease];
114
114
        
115
115
        // asset url is ignored, can be anything:
116
 
        NSDictionary *hashDict = [sharedHasher synchronouslyGetHashesForAssetURL:[NSURL URLWithString:@"http://example.com"]];
 
116
        NSDictionary *hashDict = [hasher synchronouslyGetHashesForAssetURL:[NSURL URLWithString:@"http://example.com"]];
117
117
 
118
118
        STAssertEqualObjects(hashDict[@"contentHash"], expectedContentHash, @"does not match");
119
119
        STAssertEqualObjects(hashDict[@"magicHash"], expectedMagicHash, @"does not match");