]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_curves.c
Delete .travis.yml
[openssl-gost/engine.git] / test_curves.c
index 28ccce41d2cd14367da74f3b350980cbd5000d71..27617673dea7ddd0f654ec1369b9434d089e5842 100644 (file)
 #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\n" cNORM); \
+       else \
+               printf(cGREEN "  Test passed\n" cNORM); \
+}
 
 struct test_curve {
     int nid;
@@ -222,11 +225,22 @@ int main(int argc, char **argv)
 {
     int ret = 0;
 
+    setenv("OPENSSL_ENGINES", ENGINE_DIR, 0);
+    OPENSSL_add_all_algorithms_conf();
+    ERR_load_crypto_strings();
+    ENGINE *eng;
+    T(eng = ENGINE_by_id("gost"));
+    T(ENGINE_init(eng));
+    T(ENGINE_set_default(eng, ENGINE_METHOD_ALL));
+
     struct test_curve *tc;
     for (tc = test_curves; tc->nid; tc++) {
        ret |= parameter_test(tc);
     }
 
+    ENGINE_finish(eng);
+    ENGINE_free(eng);
+
     if (ret)
        printf(cDRED "= Some tests FAILED!\n" cNORM);
     else