diff options
author | Jack Lloyd <[email protected]> | 2016-08-20 18:18:35 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-08-20 18:18:35 -0400 |
commit | 4d97bdf407f08e65eb253a2b027d26d4feb35fcf (patch) | |
tree | 5a7ab2114f631a0fdb58f3ddcc2cb120a5771f50 | |
parent | bcce9b9a2aff295aa43dd95495bfcf3c918a3967 (diff) | |
parent | c6e1dbe76d72c0d2b5bf6009acad4ac944050841 (diff) |
Merge GH #597 Fix mini build with PKCS #11
-rw-r--r-- | src/tests/test_pkcs11_high_level.cpp | 14 | ||||
-rw-r--r-- | src/tests/tests.cpp | 12 | ||||
-rw-r--r-- | src/tests/tests.h | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/src/tests/test_pkcs11_high_level.cpp b/src/tests/test_pkcs11_high_level.cpp index 82610adc6..8e894ef28 100644 --- a/src/tests/test_pkcs11_high_level.cpp +++ b/src/tests/test_pkcs11_high_level.cpp @@ -415,6 +415,7 @@ Test::Result test_attribute_container() return result; } +#if defined(BOTAN_HAS_ASN1) Test::Result test_create_destroy_data_object() { Test::Result result("Object create/delete data object"); @@ -565,6 +566,7 @@ Test::Result test_object_copy() copied_obj.destroy(); return result; } +#endif class Object_Tests : public PKCS11_Test { @@ -573,11 +575,13 @@ class Object_Tests : public PKCS11_Test { std::vector<std::function<Test::Result()>> fns = { - test_attribute_container, - test_create_destroy_data_object, - test_get_set_attribute_values, - test_object_finder, - test_object_copy + test_attribute_container +#if defined(BOTAN_HAS_ASN1) + ,test_create_destroy_data_object + ,test_get_set_attribute_values + ,test_object_finder + ,test_object_copy +#endif }; return run_pkcs11_tests("Object", fns); diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp index 578418ffb..d3467460e 100644 --- a/src/tests/tests.cpp +++ b/src/tests/tests.cpp @@ -234,6 +234,18 @@ bool Test::Result::test_gte(const std::string& what, size_t produced, size_t exp return test_success(); } +bool Test::Result::test_ne(const std::string& what, size_t produced, size_t expected) + { + if(produced != expected) + { + return test_success(); + } + + std::ostringstream err; + err << who() << " " << what << " produced " << produced << " prohibited value"; + return test_failure(err.str()); + } + #if defined(BOTAN_HAS_BIGINT) bool Test::Result::test_eq(const std::string& what, const BigInt& produced, const BigInt& expected) { diff --git a/src/tests/tests.h b/src/tests/tests.h index b33b2837f..39aaf67cd 100644 --- a/src/tests/tests.h +++ b/src/tests/tests.h @@ -225,6 +225,8 @@ class Test bool test_rc(const std::string& func, int expected, int rc); + bool test_ne(const std::string& what, size_t produced, size_t expected); + #if defined(BOTAN_HAS_BIGINT) bool test_eq(const std::string& what, const BigInt& produced, const BigInt& expected); bool test_ne(const std::string& what, const BigInt& produced, const BigInt& expected); |