From 66acb43cae733b2abb503bc5457762762c8829d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Wed, 9 Jan 2019 12:48:39 +0100 Subject: Make username shorter in KeyProvider tests USERNAME_LONG used in KeyProvider tests is 43 characters long while the structure used for storing it has only 32 characters. After adding a size check in WrappedKeyAndInfoContainer::setKeyInfoClient the tests started to fail. This commit makes the passed string fit 32 characters and adds new test. Change-Id: Ida8a574f805c9518d00ee810dbd3c2daed9ace55 --- tests/test_key-provider.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_key-provider.cpp b/tests/test_key-provider.cpp index 4991c4db..81d381d3 100644 --- a/tests/test_key-provider.cpp +++ b/tests/test_key-provider.cpp @@ -32,7 +32,7 @@ const CKM::Password INCORRECT_PASSWORD = "AAAAAAAAAAAAAAAAAAAAA"; const CKM::Password NEW_PASSWORD = "NEW12345TIZEN12345NEW"; const std::string USERNAME_SHORT = "AB"; -const std::string USERNAME_LONG = "SOFTWARE_CENTER_SYSTEM_SW_LAB_SECURITY_PART"; +const std::string USERNAME_LONG = "SOFTWARE_CENTER_SYSTEM_SW_LAB"; const std::string CLIENT_ID_1 = "SAMPLE_CLIENT_ID_1"; const std::string CLIENT_ID_2 = "SAMPLE_CLIENT_ID_2"; @@ -171,6 +171,9 @@ BOOST_AUTO_TEST_CASE(wrapped_container) BOOST_REQUIRE_NO_THROW(wrappedContainer.setKeyInfoSalt(salt.data(), salt.size())); BOOST_REQUIRE_NO_THROW(wrappedContainer.setKeyInfoClient("key_info_client")); + BOOST_REQUIRE_THROW(wrappedContainer.setKeyInfoClient("key_info_client_waaaaay_too_long"), + CKM::Exc::InternalError); + CKM::WrappedKeyAndInfoContainer wrappedContainer2; BOOST_REQUIRE_NO_THROW( wrappedContainer2.setKeyInfo(&wrappedContainer.getWrappedKeyAndInfo().keyInfo)); -- cgit v1.2.3