Files
media_cas_proxy_sdk_source/util/error_space_test.cc
Fang Yu 79f14e6e0b Fix media_cas_proxy_sdk build issue.
Add example binary for testing building the SDK after 'git clone' from our repo.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=227583629
2019-01-02 14:51:34 -08:00

34 lines
942 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 space_name() { return "Space1"; }
static std::string code_to_string(int code) {
return "Test" + std::to_string(code);
}
};
TEST(ErrorSpaceTest, Basic) {
const ErrorSpace* space1 = Space1::Get();
EXPECT_EQ("Space1", space1->SpaceName());
EXPECT_EQ(Space1::code_to_string(23), space1->String(23));
}
} // namespace
} // namespace util
} // namespace widevine