symm/: Allow block cipher and hash functions with strange names.
[catacomb] / symm / hash.h
index 31cf4a8..f492518 100644 (file)
 
 #define HASH_BUFLEN 100000
 
-#define HASH_TEST(PRE, pre)                                            \
+#define HASH_TESTX(PRE, pre, name, fname)                              \
                                                                        \
 static int verify(dstr *v)                                             \
 {                                                                      \
@@ -251,8 +251,8 @@ static int verifyrep(dstr *v)                                               \
 }                                                                      \
                                                                        \
 static test_chunk defs[] = {                                           \
-  { #pre, verify, { &type_string, &type_hex, 0 } },                    \
-  { #pre "-rep", verifyrep,                                            \
+  { name, verify, { &type_string, &type_hex, 0 } },                    \
+  { name "-rep", verifyrep,                                            \
     { &type_string, &type_int, &type_hex, 0 } },                       \
   { 0, 0, { 0 } }                                                      \
 };                                                                     \
@@ -260,14 +260,16 @@ static test_chunk defs[] = {                                              \
 int main(int argc, char *argv[])                                       \
 {                                                                      \
   ego(argv[0]);                                                                \
-  test_run(argc, argv, defs, SRCDIR"/t/" #pre);                                \
+  test_run(argc, argv, defs, SRCDIR"/t/" fname);                       \
   return (0);                                                          \
 }
 
 #else
-#  define HASH_TEST(PRE, pre)
+#  define HASH_TESTX(PRE, pre, name, fname)
 #endif
 
+#define HASH_TEST(PRE, pre) HASH_TESTX(PRE, pre, #pre, #pre)
+
 /*----- That's all, folks -------------------------------------------------*/
 
 #ifdef __cplusplus