Export media_cas_proxy_sdk

This commit is contained in:
Fang Yu
2018-11-14 09:05:33 -08:00
parent 6d0d9d825c
commit 5031d1bc6f
146 changed files with 24654 additions and 0 deletions

32
strings/serialize_test.cc Normal file
View File

@@ -0,0 +1,32 @@
////////////////////////////////////////////////////////////////////////////////
// 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.
////////////////////////////////////////////////////////////////////////////////
//
// Contains the test cases for EncodeUint64 and KeyToUint32.
#include "strings/serialize.h"
#include "testing/gunit.h"
namespace widevine {
namespace strings {
TEST(SerializeTest, KeyToUint32) {
std::string val = "\x12\x34\x56\x78";
EXPECT_EQ(0x12345678, KeyToUint32(val));
val = "\x87\x65\x43\x21";
EXPECT_EQ(0x87654321, KeyToUint32(val));
}
TEST(SerializeTest, EncodeUint64) {
uint64_t q1 = 0x4142434441424344;
std::string uint64_str = EncodeUint64(q1);
EXPECT_TRUE(uint64_str == "DCBADCBA" || uint64_str == "ABCDABCD");
}
} // namespace strings
} // namespace widevine