ObjFW  Check-in [7172d2539b]

Overview
Comment:Nicer output for OFHashes tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7172d2539bebda49397116126106b4cb839fce56bd2e9400962d008894017f3d
User & Date: js on 2008-12-14 11:47:45
Other Links: manifest | tags
Context
2008-12-14
15:00
Check whether we can use snprintf in our asprintf implementation. check-in: 454129c81d user: js tags: trunk
11:47
Nicer output for OFHashes tests. check-in: 7172d2539b user: js tags: trunk
02:12
This is more safe. check-in: 7ddd9e5d35 user: js tags: trunk
Changes

Modified tests/OFHashes/OFHashes.m from [04796aa034] to [45e2193d62].

40
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
		[md5 updateWithBuffer: buf
			       ofSize: len];
		[sha1 updateWithBuffer: buf
				ofSize: len];
	}
	[f free];

	if (!memcmp([md5 digest], testfile_md5, MD5_DIGEST_SIZE))
		puts("Correct MD5 sum calculated!");

	else {
		puts("MD5 SUM MISMATCH!!");
		return 1;
	}
	[md5 free];

	if (!memcmp([sha1 digest], testfile_sha1, SHA1_DIGEST_SIZE))
		puts("Correct SHA1 sum calculated!");
	else {
		puts("SHA1 SUM MISMATCH!!");
		return 1;
	}
	[sha1 free];

	return 0;
}







|
|
>
|
|





|

|






40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
		[md5 updateWithBuffer: buf
			       ofSize: len];
		[sha1 updateWithBuffer: buf
				ofSize: len];
	}
	[f free];

	if (!memcmp([md5 digest], testfile_md5, MD5_DIGEST_SIZE)) {
		fputs("\r\033[1;33mTests successful: 1/2\033[0m", stdout);
		fflush(stdout);
	} else {
		puts("\r\033[K\033[1;31mTest 1/2 failed!\033[0m");
		return 1;
	}
	[md5 free];

	if (!memcmp([sha1 digest], testfile_sha1, SHA1_DIGEST_SIZE))
		puts("\r\033[1;32mTests successful: 2/2\033[0m");
	else {
		puts("\r\033[K\033[1;31mTest 2/2 failed!\033[0m");
		return 1;
	}
	[sha1 free];

	return 0;
}