mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-28 01:41:48 +03:00
tests: Properly initilize library in threads tests
This was already done in the torture_threads_pki. Without the explicit initialization, we can observe random failures tests (at least of the torture_threads_crypto) from various threads. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
b4c8bd9fe4
commit
6b10bbea2f
@ -589,8 +589,14 @@ int torture_run_tests(void)
|
|||||||
cmocka_unit_test(torture_mixed),
|
cmocka_unit_test(torture_mixed),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the library is statically linked, ssh_init() is not called
|
||||||
|
* automatically
|
||||||
|
*/
|
||||||
|
ssh_init();
|
||||||
torture_filter_tests(tests);
|
torture_filter_tests(tests);
|
||||||
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
||||||
|
ssh_finalize();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,13 @@ int torture_run_tests(void)
|
|||||||
cmocka_unit_test(torture_crypto_aes256_cbc),
|
cmocka_unit_test(torture_crypto_aes256_cbc),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the library is statically linked, ssh_init() is not called
|
||||||
|
* automatically
|
||||||
|
*/
|
||||||
|
ssh_init();
|
||||||
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
||||||
|
ssh_finalize();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -88,8 +88,14 @@ int torture_run_tests(void)
|
|||||||
cmocka_unit_test(torture_ssh_init),
|
cmocka_unit_test(torture_ssh_init),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the library is statically linked, ssh_init() is not called
|
||||||
|
* automatically
|
||||||
|
*/
|
||||||
|
ssh_init();
|
||||||
torture_filter_tests(tests);
|
torture_filter_tests(tests);
|
||||||
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
||||||
|
ssh_finalize();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user