Files
media_cas_packager_sdk_source/util/error_space_test.cc
2018-10-01 14:59:29 -07:00

32 lines
931 B
C++

////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 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/error_space.h"
#include "testing/gunit.h"
namespace widevine {
namespace util {
namespace {
class Space1 : public util::ErrorSpaceImpl<Space1> {
public:
static std::string SpaceName() { return "Space1"; }
static std::string CodeToString(int code) { return "Test" + std::to_string(code); }
};
TEST(ErrorSpaceTest, Basic) {
const ErrorSpace* space1 = Space1::Get();
EXPECT_EQ("Space1", space1->SpaceName());
EXPECT_EQ(Space1::CodeToString(23), space1->String(23));
}
} // namespace
} // namespace util
} // namespace widevine