Export provisioning sdk
Change-Id: I4d47d80444c9507f84896767dc676112ca11e901
This commit is contained in:
29
common/file_util_test.cc
Normal file
29
common/file_util_test.cc
Normal file
@@ -0,0 +1,29 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2016 Google Inc.
|
||||
//
|
||||
// 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/file_util.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace widevine {
|
||||
|
||||
TEST(FileUtilTest, EmptyFileName) {
|
||||
std::string contents;
|
||||
EXPECT_FALSE(GetContents("", &contents));
|
||||
EXPECT_FALSE(SetContents("", "test content"));
|
||||
}
|
||||
|
||||
TEST(FileUtilTest, BasicTest) {
|
||||
const std::string file_path = FLAGS_test_tmpdir + "/file_util_test";
|
||||
EXPECT_TRUE(SetContents(file_path, "test content"));
|
||||
std::string contents;
|
||||
EXPECT_TRUE(GetContents(file_path, &contents));
|
||||
EXPECT_EQ("test content", contents);
|
||||
}
|
||||
|
||||
} // namespace widevine
|
||||
Reference in New Issue
Block a user