Skip to content
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

Merged
merged 4 commits into from
Sep 13, 2019
Merged

Unittest for cryspr methods #864

merged 4 commits into from
Sep 13, 2019

Conversation

jeandube
Copy link
Collaborator

@jeandube jeandube commented Sep 6, 2019

Fixed returned values of fallback kmwrap and kmunwrap methods
Made cryspr.h header C++ compatible (for unittest prog)

Fixed returned values of fallback kmwrap and kmunwrap methods
Made cryspr.h header C++ compatible (for unittest prog)
@ethouris
Copy link
Collaborator

ethouris commented Sep 9, 2019

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:

target_include_directories(haicrypt_virtual PRIVATE  ${SSL_INCLUDE_DIRS})

The same like this must be added to the test_srt application.

Enabled a commented out test section (kmwrap)
@jeandube
Copy link
Collaborator Author

jeandube commented Sep 9, 2019

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?

@maxsharabayko
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

Copy link
Collaborator

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
@maxsharabayko maxsharabayko added this to the v1.4.0 milestone Sep 13, 2019
@maxsharabayko maxsharabayko added the [tests] Area: Unit tests label Sep 13, 2019
@rndi rndi merged commit d90aef0 into Haivision:master Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[tests] Area: Unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants