Skip to content

Commit

Permalink
Added testcase for packSHA1FromBytes
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Garside <geoff@geoffgarside.co.uk>
  • Loading branch information
chapados authored and geoffgarside committed Jun 17, 2009
1 parent c45fb82 commit 5f139e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UnitTests/Source/GITUtilityBeltTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ - (void)testPackedSHA1String
{
GHAssertEquals([packedSHA1String length], (NSUInteger)20, nil);
}

- (void)testShouldPackSHA1FromString
{
NSData * packed = packSHA1(unpackedSHA1);
GHAssertEquals([packed length], (NSUInteger)20, nil);
GHAssertEqualObjects(packed, packedSHA1Data, nil);
}

- (void)testPackSHA1FromBytes
{
NSData * packed = packSHA1FromBytes("bed4001738fa8dad666d669867afaf9f2c2b8c6a");
GHAssertEquals([packed length], (NSUInteger)20, nil);
GHAssertEqualObjects(packed, packedSHA1Data, nil);
}

- (void)testUnpackedSHA1StringEncoding
{
NSString *unpackedCString = [[[NSString alloc] initWithCString:"bed4001738fa8dad666d669867afaf9f2c2b8c6a" encoding:NSASCIIStringEncoding] autorelease];
Expand Down

0 comments on commit 5f139e0

Please sign in to comment.