Export media_cas_proxy_sdk
This commit is contained in:
55
util/proto_status_test.cc
Normal file
55
util/proto_status_test.cc
Normal file
@@ -0,0 +1,55 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2007 Google LLC.
|
||||
//
|
||||
// This software is licensed under the terms defined in the Widevine Master
|
||||
// License Agreement. For a copy of this agreement, please contact
|
||||
// widevine-licensing@google.com.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "util/proto_status.h"
|
||||
|
||||
#include "testing/gunit.h"
|
||||
#include "protos/public/errors.pb.h"
|
||||
|
||||
namespace widevine {
|
||||
namespace util {
|
||||
|
||||
TEST(StatusTest, PROVIDER_ID_MISMATCH_Status) {
|
||||
Status status(ProtoEnumErrorSpace<Errors>::Get(), PROVIDER_ID_MISMATCH,
|
||||
"provider_id_mismatch");
|
||||
EXPECT_EQ("Errors::PROVIDER_ID_MISMATCH: provider_id_mismatch",
|
||||
status.ToString());
|
||||
}
|
||||
|
||||
TEST(StatusTest, PROVIDER_ID_MISMATCH_Status2) {
|
||||
Status status(static_cast<error::StatusCode>(PROVIDER_ID_MISMATCH),
|
||||
"provider_id_mismatch");
|
||||
EXPECT_EQ("Errors::157: provider_id_mismatch", status.ToString());
|
||||
}
|
||||
|
||||
TEST(StatusTest, Same) {
|
||||
Status status1(ProtoEnumErrorSpace<Errors>::Get(), PROVIDER_ID_MISMATCH,
|
||||
"provider_id_mismatch");
|
||||
Status status2(ProtoEnumErrorSpace<Errors>::Get(), PROVIDER_ID_MISMATCH,
|
||||
"this is a provider_id_mismatch error");
|
||||
EXPECT_EQ(status1, status2);
|
||||
}
|
||||
|
||||
TEST(StatusTest, NotTheSameStatus) {
|
||||
Status status1(ProtoEnumErrorSpace<Errors>::Get(), PROVIDER_ID_MISMATCH,
|
||||
"provider_id_mismatch");
|
||||
Status status2(ProtoEnumErrorSpace<Errors>::Get(), MISSING_CLIENT_ID,
|
||||
"missing client id");
|
||||
EXPECT_NE(status1, status2);
|
||||
}
|
||||
|
||||
TEST(StatusTest, NotTheSameErrorSpace) {
|
||||
Status status1(ProtoEnumErrorSpace<Errors>::Get(), PROVIDER_ID_MISMATCH,
|
||||
"provider_id_mismatch");
|
||||
Status status2(static_cast<error::StatusCode>(PROVIDER_ID_MISMATCH),
|
||||
"this is a provider_id_mismatch error");
|
||||
EXPECT_NE(status1, status2);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace widevine
|
||||
Reference in New Issue
Block a user