-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unittest for cryspr methods #864
Conversation
Fixed returned values of fallback kmwrap and kmunwrap methods Made cryspr.h header C++ compatible (for unittest prog)
The build fails due to lacking include directories; this is the first test that would include (indirectly) the openssl headers. For the SRT library (haicrypt in particular) this is fixed by this line:
The same like this must be added to the |
Enabled a commented out test section (kmwrap)
test_cryspr was tested with OpenSSL and GnuTLS but I was not able to test with mbedTLS. Is it part of the Travis or Appveyor tests? |
Unfortunately, both Travis and AppVeyor build only OpenSSL. Support for all those build options is in the TODO list. |
CMakeLists.txt
Outdated
@@ -908,7 +908,7 @@ if (ENABLE_EXAMPLES) | |||
endif() | |||
|
|||
|
|||
if (ENABLE_UNITTESTS AND ENABLE_CXX11) | |||
if (ENABLE_UNITTESTS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit tests should be enabled only with C++11 simply because the test driver library requires it - it doesn't matter if it's required by the test procedure itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change GCC 4.6.3 which is not C++11 can generate a working test_srt.
Here the cmake command I use cmake . -DUSE_ENCLIB=openssl -DENABLE_CXX11=OFF -DENABLE_UNITTESTS=1 -DHAVE_COMPILER_GNU_COMPAT=OFF -DINSTALL_GTEST=OFF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I guess if you set -DINSTALL_GTEST=OFF
, you must have had the gtest library already installed and compiled by a C++11-compliant compiler.
And anyway, ENABLE_UNITTESTS
enables all unit tests, and it suffices that at least one of them requires C++11, as most of them do, to require C++11-compliance for all of them. The idea for the unit tests is that they are run automatically, so even splitting them into those that require C++11 and those that don't doesn't make much sense, as all are intended to be run anyway.
Made unittests self-contained and order independent added AES-ECB tests
Fixed returned values of fallback kmwrap and kmunwrap methods
Made cryspr.h header C++ compatible (for unittest prog)