diff options
author | Haris Andrianakis <candrian@google.com> | 2018-07-11 07:58:16 -0700 |
---|---|---|
committer | Tink Team <noreply@google.com> | 2018-07-11 18:42:34 -0400 |
commit | a7c0b6f6b999e74e19a0da822e1318e893dbb30f (patch) | |
tree | 3664e94d2f89929b4c5cff4d5409c327fef0ecdd /cc/mac/mac_factory_test.cc | |
parent | 81cdb2ae245e2e72857f5ecfa584df0979cf98aa (diff) | |
download | tink-a7c0b6f6b999e74e19a0da822e1318e893dbb30f.tar.gz |
Move TestUtil::GetKeyset, TestUtil::GetKeysetHandle to a separate class so they
are usable by Obj-C code (not just tests).
PiperOrigin-RevId: 204124489
GitOrigin-RevId: 5df6f3544e3b7da83dde0a2c08ea0e8e8e4bfe38
Diffstat (limited to 'cc/mac/mac_factory_test.cc')
-rw-r--r-- | cc/mac/mac_factory_test.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cc/mac/mac_factory_test.cc b/cc/mac/mac_factory_test.cc index 4fb239b33..3b226436d 100644 --- a/cc/mac/mac_factory_test.cc +++ b/cc/mac/mac_factory_test.cc @@ -16,19 +16,20 @@ #include "tink/mac/mac_factory.h" -#include "tink/mac.h" +#include "gtest/gtest.h" #include "tink/crypto_format.h" #include "tink/keyset_handle.h" +#include "tink/mac.h" #include "tink/mac/hmac_key_manager.h" #include "tink/mac/mac_config.h" +#include "tink/util/keyset_util.h" #include "tink/util/status.h" #include "tink/util/test_util.h" -#include "gtest/gtest.h" #include "proto/common.pb.h" #include "proto/hmac.pb.h" #include "proto/tink.pb.h" -using crypto::tink::TestUtil; +using crypto::tink::KeysetUtil; using crypto::tink::test::AddRawKey; using crypto::tink::test::AddTinkKey; using google::crypto::tink::HashType; @@ -48,7 +49,7 @@ class MacFactoryTest : public ::testing::Test { TEST_F(MacFactoryTest, testBasic) { Keyset keyset; auto mac_result = - MacFactory::GetPrimitive(*TestUtil::GetKeysetHandle(keyset)); + MacFactory::GetPrimitive(*KeysetUtil::GetKeysetHandle(keyset)); EXPECT_FALSE(mac_result.ok()); EXPECT_EQ(util::error::INVALID_ARGUMENT, mac_result.status().error_code()); EXPECT_PRED_FORMAT2(testing::IsSubstring, "at least one key", @@ -90,7 +91,7 @@ TEST_F(MacFactoryTest, testPrimitive) { // Create a KeysetHandle and use it with the factory. auto mac_result = - MacFactory::GetPrimitive(*TestUtil::GetKeysetHandle(keyset)); + MacFactory::GetPrimitive(*KeysetUtil::GetKeysetHandle(keyset)); EXPECT_TRUE(mac_result.ok()) << mac_result.status(); auto mac = std::move(mac_result.ValueOrDie()); |