]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_curves.c
MSVC: Avoid use `htonl' since it requires linking with Winsock
[openssl-gost/engine.git] / test_curves.c
index 28ccce41d2cd14367da74f3b350980cbd5000d71..73c47d91e62d7b64a54f30f78d74633afdaf4755 100644 (file)
@@ -5,7 +5,6 @@
  * See https://www.openssl.org/source/license.html for details
  */
 
-#include "e_gost_err.h"
 #include "gost_lcl.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #define cBLUE  "\033[1;34m"
 #define cDBLUE "\033[0;34m"
 #define cNORM  "\033[m"
-#define TEST_ASSERT(e) {if ((test = (e))) \
-                printf(cRED "  Test FAILED\n" cNORM); \
-            else \
-                printf(cGREEN "  Test passed\n" cNORM);}
+#define TEST_ASSERT(e) { \
+       test = e; \
+       if (test) \
+               printf(cRED "  Test FAILED" cNORM "\n"); \
+       else \
+               printf(cGREEN "  Test passed" cNORM "\n"); \
+}
 
 struct test_curve {
     int nid;
@@ -90,7 +92,7 @@ static int parameter_test(struct test_curve *tc)
     printf("\n");
 
     if (!OBJ_nid2obj(nid)) {
-       printf(cRED "NID %d not found\n" cNORM, nid);
+       printf(cRED "NID %d not found" cNORM "\n", nid);
        return 1;
     }
 
@@ -106,7 +108,7 @@ static int parameter_test(struct test_curve *tc)
     EC_KEY *ec;
     T(ec = EC_KEY_new());
     if (!fill_GOST_EC_params(ec, nid)) {
-       printf(cRED "fill_GOST_EC_params FAIL\n" cNORM);
+       printf(cRED "fill_GOST_EC_params FAIL" cNORM "\n");
        ERR_print_errors_fp(stderr);
        return 1;
     }
@@ -228,8 +230,8 @@ int main(int argc, char **argv)
     }
 
     if (ret)
-       printf(cDRED "= Some tests FAILED!\n" cNORM);
+       printf(cDRED "= Some tests FAILED!" cNORM "\n");
     else
-       printf(cDGREEN "= All tests passed!\n" cNORM);
+       printf(cDGREEN "= All tests passed!" cNORM "\n");
     return ret;
 }