diff options
author | Hannes Rantzsch <[email protected]> | 2019-04-29 11:20:31 +0200 |
---|---|---|
committer | Hannes Rantzsch <[email protected]> | 2019-04-29 11:20:31 +0200 |
commit | 3be7818d5c366b887e4c61964ae87f6d52de0659 (patch) | |
tree | 03b2935a0e36565cfb3fa69126ba01adac0972be /src | |
parent | 9b43c12e39105ccc8fb02a73f27ab807688b979c (diff) |
review: unit tests and public api version
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/utils/exceptn.h | 3 | ||||
-rw-r--r-- | src/tests/unit_asio_stream.cpp | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/utils/exceptn.h b/src/lib/utils/exceptn.h index 801cacdb2..0ca888316 100644 --- a/src/lib/utils/exceptn.h +++ b/src/lib/utils/exceptn.h @@ -72,7 +72,8 @@ enum class ErrorType { }; -std::string BOTAN_PUBLIC_API(2,0) to_string(ErrorType type); +//! \brief Convert an ErrorType to string +std::string BOTAN_PUBLIC_API(2,11) to_string(ErrorType type); /** * Base class for all exceptions thrown by the library diff --git a/src/tests/unit_asio_stream.cpp b/src/tests/unit_asio_stream.cpp index 704c4f305..ee80cdba4 100644 --- a/src/tests/unit_asio_stream.cpp +++ b/src/tests/unit_asio_stream.cpp @@ -10,13 +10,13 @@ #if defined(BOTAN_HAS_TLS) && defined(BOTAN_HAS_BOOST_ASIO) +#include <botan/asio_stream.h> +#include <botan/tls_callbacks.h> + // first boost version to include boost/beast/experimental/test/stream.hpp #include <boost/version.hpp> #if BOOST_VERSION >= 106800 -#include <botan/asio_stream.h> -#include <botan/tls_callbacks.h> - #include <boost/beast/experimental/test/stream.hpp> #include <boost/bind.hpp> @@ -133,7 +133,10 @@ class Asio_Stream_Tests final : public Test // use memcmp to check if the data in a is a prefix of the data in b bool contains(const void* a, const void* b, const std::size_t size) { return memcmp(a, b, size) == 0; } - boost::string_view test_data() const { return boost::string_view((const char*)TEST_DATA, TEST_DATA_SIZE); } + boost::string_view test_data() const + { + return boost::string_view(reinterpret_cast<const char*>(TEST_DATA), TEST_DATA_SIZE); + } void test_sync_handshake(std::vector<Test::Result>& results) { @@ -764,7 +767,7 @@ class Asio_Stream_Tests final : public Test } }; -BOTAN_REGISTER_TEST("asio_stream", Asio_Stream_Tests); +BOTAN_REGISTER_TEST("tls_asio_stream", Asio_Stream_Tests); } // namespace Botan_Tests |