29 lines
818 B
C++
29 lines
818 B
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Copyright 2016 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 "common/random_util.h"
|
|
#include "testing/gunit.h"
|
|
|
|
namespace widevine {
|
|
|
|
TEST(RandomUtilTest, Test) {
|
|
std::string output;
|
|
ASSERT_TRUE(RandomBytes(16u, &output));
|
|
EXPECT_EQ(16u, output.size());
|
|
|
|
std::string output2;
|
|
ASSERT_TRUE(RandomBytes(16u, &output2));
|
|
EXPECT_EQ(16u, output2.size());
|
|
EXPECT_NE(output, output2);
|
|
|
|
ASSERT_TRUE(RandomBytes(10u, &output2));
|
|
EXPECT_EQ(10u, output2.size());
|
|
}
|
|
|
|
} // namespace widevine
|