From 356ec5a86978143991db5b667ccc5ea815a73d00 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 9 Jul 2015 09:35:18 +0200 Subject: Add test: stl_util; Add empty test: utils --- src/tests/catchy/test_stl_util.cpp | 21 +++++++++++++++++++++ src/tests/catchy/test_utils.cpp | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 src/tests/catchy/test_stl_util.cpp create mode 100644 src/tests/catchy/test_utils.cpp (limited to 'src/tests') diff --git a/src/tests/catchy/test_stl_util.cpp b/src/tests/catchy/test_stl_util.cpp new file mode 100644 index 000000000..a0b38b045 --- /dev/null +++ b/src/tests/catchy/test_stl_util.cpp @@ -0,0 +1,21 @@ +// (C) 2015 Simon Warta (Kullo GmbH) +// Botan is released under the Simplified BSD License (see license.txt) + +#include "catch.hpp" +#include +#include + +TEST_CASE("secure vector to string", "[STL_Util]") + { + using namespace Botan; + auto empty = secure_vector{ }; + auto one = secure_vector{ 94 }; + auto some = secure_vector{ 0x48, 0x65, 0x6c, 0x6c, 0x6f }; + // echo -n "ö" | hexdump -C + auto utf8 = secure_vector{ 0xc3, 0xb6 }; + + CHECK(( to_string(empty) == "" )); + CHECK(( to_string(one) == "^" )); + CHECK(( to_string(some) == "Hello" )); + CHECK(( to_string(utf8) == "ö" )); + } diff --git a/src/tests/catchy/test_utils.cpp b/src/tests/catchy/test_utils.cpp new file mode 100644 index 000000000..17c35a678 --- /dev/null +++ b/src/tests/catchy/test_utils.cpp @@ -0,0 +1,7 @@ +// (C) 2015 Simon Warta (Kullo GmbH) +// Botan is released under the Simplified BSD License (see license.txt) + +#include "catch.hpp" + +using namespace Botan; + -- cgit v1.2.3