/pidgin/main: 950e390d9d42: Remove the old tests for the hashes ...
Gary Kramlich
grim at reaperworld.com
Wed Mar 30 19:25:27 EDT 2016
Changeset: 950e390d9d42ac4d1b9de836e82386a1e09a3907
Author: Gary Kramlich <grim at reaperworld.com>
Date: 2016-03-09 22:23 -0600
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/950e390d9d42
Description:
Remove the old tests for the hashes that have been ported to gtester
diffstat:
libpurple/tests/test_cipher.c | 235 ------------------------------------------
1 files changed, 0 insertions(+), 235 deletions(-)
diffs (245 lines):
diff --git a/libpurple/tests/test_cipher.c b/libpurple/tests/test_cipher.c
--- a/libpurple/tests/test_cipher.c
+++ b/libpurple/tests/test_cipher.c
@@ -16,241 +16,6 @@
#include "../ciphers/sha256hash.h"
/******************************************************************************
- * MD4 Tests
- *****************************************************************************/
-#define MD4_TEST(data, digest) { \
- PurpleHash *hash = NULL; \
- gchar cdigest[33]; \
- gboolean ret = FALSE; \
- \
- hash = purple_md4_hash_new(); \
- purple_hash_append(hash, (guchar *)(data), strlen((data))); \
- \
- ret = purple_hash_digest_to_str(hash, cdigest, sizeof(cdigest)); \
- \
- fail_unless(ret == TRUE, NULL); \
- \
- fail_unless(strcmp((digest), cdigest) == 0, NULL); \
- \
- g_object_unref(hash); \
-}
-
-START_TEST(test_md4_empty_string) {
- MD4_TEST("", "31d6cfe0d16ae931b73c59d7e0c089c0");
-}
-END_TEST
-
-START_TEST(test_md4_a) {
- MD4_TEST("a", "bde52cb31de33e46245e05fbdbd6fb24");
-}
-END_TEST
-
-START_TEST(test_md4_abc) {
- MD4_TEST("abc", "a448017aaf21d8525fc10ae87aa6729d");
-}
-END_TEST
-
-START_TEST(test_md4_message_digest) {
- MD4_TEST("message digest", "d9130a8164549fe818874806e1c7014b");
-}
-END_TEST
-
-START_TEST(test_md4_a_to_z) {
- MD4_TEST("abcdefghijklmnopqrstuvwxyz",
- "d79e1c308aa5bbcdeea8ed63df412da9");
-}
-END_TEST
-
-START_TEST(test_md4_A_to_Z_a_to_z_0_to_9) {
- MD4_TEST("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
- "043f8582f241db351ce627e153e7f0e4");
-}
-END_TEST
-
-START_TEST(test_md4_1_to_0_8_times) {
- MD4_TEST("123456789012345678901234567890123456789012345678901234567890"
- "12345678901234567890",
- "e33b4ddc9c38f2199c3e7b164fcc0536");
-}
-END_TEST
-
-
-/******************************************************************************
- * MD5 Tests
- *****************************************************************************/
-#define MD5_TEST(data, digest) { \
- PurpleHash *hash = NULL; \
- gchar cdigest[33]; \
- gboolean ret = FALSE; \
- \
- hash = purple_md5_hash_new(); \
- purple_hash_append(hash, (guchar *)(data), strlen((data))); \
- \
- ret = purple_hash_digest_to_str(hash, cdigest, sizeof(cdigest)); \
- \
- fail_unless(ret == TRUE, NULL); \
- \
- fail_unless(strcmp((digest), cdigest) == 0, NULL); \
- \
- g_object_unref(hash); \
-}
-
-START_TEST(test_md5_empty_string) {
- MD5_TEST("", "d41d8cd98f00b204e9800998ecf8427e");
-}
-END_TEST
-
-START_TEST(test_md5_a) {
- MD5_TEST("a", "0cc175b9c0f1b6a831c399e269772661");
-}
-END_TEST
-
-START_TEST(test_md5_abc) {
- MD5_TEST("abc", "900150983cd24fb0d6963f7d28e17f72");
-}
-END_TEST
-
-START_TEST(test_md5_message_digest) {
- MD5_TEST("message digest", "f96b697d7cb7938d525a2f31aaf161d0");
-}
-END_TEST
-
-START_TEST(test_md5_a_to_z) {
- MD5_TEST("abcdefghijklmnopqrstuvwxyz",
- "c3fcd3d76192e4007dfb496cca67e13b");
-}
-END_TEST
-
-START_TEST(test_md5_A_to_Z_a_to_z_0_to_9) {
- MD5_TEST("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
- "d174ab98d277d9f5a5611c2c9f419d9f");
-}
-END_TEST
-
-START_TEST(test_md5_1_to_0_8_times) {
- MD5_TEST("123456789012345678901234567890123456789012345678901234567890"
- "12345678901234567890",
- "57edf4a22be3c955ac49da2e2107b67a");
-}
-END_TEST
-
-/******************************************************************************
- * SHA-1 Tests
- *****************************************************************************/
-#define SHA1_TEST(data, digest) { \
- PurpleHash *hash = NULL; \
- gchar cdigest[41]; \
- gboolean ret = FALSE; \
- gchar *input = data; \
- \
- hash = purple_sha1_hash_new(); \
- \
- if (input) { \
- purple_hash_append(hash, (guchar *)input, strlen(input)); \
- } else { \
- gint j; \
- guchar buff[1000]; \
- \
- memset(buff, 'a', 1000); \
- \
- for(j = 0; j < 1000; j++) \
- purple_hash_append(hash, buff, 1000); \
- } \
- \
- ret = purple_hash_digest_to_str(hash, cdigest, sizeof(cdigest)); \
- \
- fail_unless(ret == TRUE, NULL); \
- \
- fail_unless(strcmp((digest), cdigest) == 0, NULL); \
- \
- g_object_unref(hash); \
-}
-
-START_TEST(test_sha1_empty_string) {
- SHA1_TEST("", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
-}
-END_TEST
-
-START_TEST(test_sha1_a) {
- SHA1_TEST("a", "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8");
-}
-END_TEST
-
-START_TEST(test_sha1_abc) {
- SHA1_TEST("abc", "a9993e364706816aba3e25717850c26c9cd0d89d");
-}
-END_TEST
-
-START_TEST(test_sha1_abcd_gibberish) {
- SHA1_TEST("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
- "84983e441c3bd26ebaae4aa1f95129e5e54670f1");
-}
-END_TEST
-
-START_TEST(test_sha1_1000_as_1000_times) {
- SHA1_TEST(NULL, "34aa973cd4c4daa4f61eeb2bdbad27316534016f");
-}
-END_TEST
-
-/******************************************************************************
- * SHA-256 Tests
- *****************************************************************************/
-#define SHA256_TEST(data, digest) { \
- PurpleHash *hash = NULL; \
- gchar cdigest[65]; \
- gboolean ret = FALSE; \
- gchar *input = data; \
- \
- hash = purple_sha256_hash_new(); \
- \
- if (input) { \
- purple_hash_append(hash, (guchar *)input, strlen(input)); \
- } else { \
- gint j; \
- guchar buff[1000]; \
- \
- memset(buff, 'a', 1000); \
- \
- for(j = 0; j < 1000; j++) \
- purple_hash_append(hash, buff, 1000); \
- } \
- \
- ret = purple_hash_digest_to_str(hash, cdigest, sizeof(cdigest)); \
- \
- fail_unless(ret == TRUE, NULL); \
- \
- fail_unless(strcmp((digest), cdigest) == 0, NULL); \
- \
- g_object_unref(hash); \
-}
-
-START_TEST(test_sha256_empty_string) {
- SHA256_TEST("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
-}
-END_TEST
-
-START_TEST(test_sha256_a) {
- SHA256_TEST("a", "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb");
-}
-END_TEST
-
-START_TEST(test_sha256_abc) {
- SHA256_TEST("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad");
-}
-END_TEST
-
-START_TEST(test_sha256_abcd_gibberish) {
- SHA256_TEST("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
- "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
-}
-END_TEST
-
-START_TEST(test_sha256_1000_as_1000_times) {
- SHA256_TEST(NULL, "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0");
-}
-END_TEST
-
-/******************************************************************************
* DES Tests
*****************************************************************************/
#define DES_TEST(in, keyz, out, len) { \
More information about the Commits
mailing list