aboutsummaryrefslogtreecommitdiff
path: root/cc/mac/mac_config_test.cc
diff options
context:
space:
mode:
authortholenst <tholenst@google.com>2019-08-05 08:30:07 -0700
committerCopybara-Service <copybara-worker@google.com>2019-08-05 08:30:40 -0700
commit625dafde0cf7f97b0010159c451346caa2d2c22c (patch)
treef26d24af70ff679646ec02dd2503acb654a68a07 /cc/mac/mac_config_test.cc
parent9344b1c13ca7868273e2f8065f6f4df707a7cdbd (diff)
downloadtink-625dafde0cf7f97b0010159c451346caa2d2c22c.tar.gz
Always use the Status result in some of the Tink unit tests.
These changes are necessary to add ABSL_MUST_USE_RESULT to our util::Status. I will have to run the main change through a global presubmit, so I want to do the Tink changes first. Also, here we only do the changes *required in tests*. PiperOrigin-RevId: 261691203
Diffstat (limited to 'cc/mac/mac_config_test.cc')
-rw-r--r--cc/mac/mac_config_test.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/cc/mac/mac_config_test.cc b/cc/mac/mac_config_test.cc
index 0a007a72c..a6208e61d 100644
--- a/cc/mac/mac_config_test.cc
+++ b/cc/mac/mac_config_test.cc
@@ -46,7 +46,7 @@ TEST_F(MacConfigTest, Basic) {
EXPECT_THAT(
Registry::get_key_manager<Mac>(HmacKeyManager().get_key_type()).status(),
StatusIs(util::error::NOT_FOUND));
- MacConfig::Register();
+ ASSERT_THAT(MacConfig::Register(), IsOk());
EXPECT_THAT(
Registry::get_key_manager<Mac>(HmacKeyManager().get_key_type()).status(),
IsOk());
@@ -62,9 +62,13 @@ TEST_F(MacConfigTest, WrappersRegistered) {
key.set_key_id(1234);
key.set_output_prefix_type(google::crypto::tink::OutputPrefixType::RAW);
auto primitive_set = absl::make_unique<PrimitiveSet<Mac>>();
- primitive_set->set_primary(
- primitive_set->AddPrimitive(absl::make_unique<DummyMac>("dummy"), key)
- .ValueOrDie());
+ ASSERT_TRUE(
+ primitive_set
+ ->set_primary(
+ primitive_set
+ ->AddPrimitive(absl::make_unique<DummyMac>("dummy"), key)
+ .ValueOrDie())
+ .ok());
auto primitive_result = Registry::Wrap(std::move(primitive_set));