Move utils unit tests to a utils specific test dir

[ Merge of http://go/wvgerrit/85804 ]

This moves file_utils_unittest.cpp, file_store_unittest.cpp and
base64_test.cpp from core/test to utils/test.

Bug: 140639279
Test: Android unit/integration
Change-Id: I1c31e5a716a925478fc1efe9fe68b93b1514e89c
This commit is contained in:
Rahul Frias
2019-09-06 14:01:42 -07:00
parent 3ba51eccd6
commit 40cc1d25bb
4 changed files with 25 additions and 27 deletions

View File

@@ -9,7 +9,7 @@ LOCAL_PATH := $(call my-dir)
# routine. # routine.
test_name := base64_test test_name := base64_test
test_src_dir := ../core/test test_src_dir := ../util/test
include $(LOCAL_PATH)/unit-test.mk include $(LOCAL_PATH)/unit-test.mk
test_name := buffer_reader_test test_name := buffer_reader_test
@@ -67,11 +67,11 @@ test_src_dir := ../metrics/test
include $(LOCAL_PATH)/unit-test.mk include $(LOCAL_PATH)/unit-test.mk
test_name := file_store_unittest test_name := file_store_unittest
test_src_dir := ../core/test test_src_dir := ../util/test
include $(LOCAL_PATH)/unit-test.mk include $(LOCAL_PATH)/unit-test.mk
test_name := file_utils_unittest test_name := file_utils_unittest
test_src_dir := . test_src_dir := ../util/test
include $(LOCAL_PATH)/unit-test.mk include $(LOCAL_PATH)/unit-test.mk
test_name := generic_crypto_unittest test_name := generic_crypto_unittest

View File

@@ -42,8 +42,8 @@ const std::string kOneByteOverB64Data("SGVsbG8gRnJpZW5kIQ==");
const std::string kTwoBytesOverB64Data("SGVsbG8gRnJpZW5kISE="); const std::string kTwoBytesOverB64Data("SGVsbG8gRnJpZW5kISE=");
const std::string kB64TestData = "GPFc9rc+INmI8FwtyTrUrv6xnKHWZNZ/5uaT21nFjNg="; const std::string kB64TestData = "GPFc9rc+INmI8FwtyTrUrv6xnKHWZNZ/5uaT21nFjNg=";
const std::pair<const std::string *, const std::string *> kBase64TestVectors[] = const std::pair<const std::string*, const std::string*> kBase64TestVectors[] = {
{make_pair(&kNullString, &kNullString), make_pair(&kNullString, &kNullString),
make_pair(&kf, &kfB64), make_pair(&kf, &kfB64),
make_pair(&kfo, &kfoB64), make_pair(&kfo, &kfoB64),
make_pair(&kfoo, &kfooB64), make_pair(&kfoo, &kfooB64),

View File

@@ -104,8 +104,7 @@ TEST_F(FileTest, FileSize) {
EXPECT_EQ(file->Write(write_data.data(), write_data_size), write_data_size); EXPECT_EQ(file->Write(write_data.data(), write_data_size), write_data_size);
EXPECT_TRUE(file_system.Exists(path)); EXPECT_TRUE(file_system.Exists(path));
EXPECT_EQ(static_cast<ssize_t>(write_data_size), EXPECT_EQ(static_cast<ssize_t>(write_data_size), file_system.FileSize(path));
file_system.FileSize(path));
} }
TEST_F(FileTest, WriteReadBinaryFile) { TEST_F(FileTest, WriteReadBinaryFile) {
@@ -159,9 +158,8 @@ TEST_F(FileTest, ListFiles) {
// Should find three files. Order not important. // Should find three files. Order not important.
EXPECT_EQ(3u, names.size()); EXPECT_EQ(3u, names.size());
EXPECT_THAT(names, ::testing::UnorderedElementsAre(kTestFileName, EXPECT_THAT(names, ::testing::UnorderedElementsAre(
kTestFileName2, kTestFileName, kTestFileName2, kTestFileName3));
kTestFileName3));
std::string wild_card_path = path_dir + kWildcard + kTestFileNameExt; std::string wild_card_path = path_dir + kWildcard + kTestFileNameExt;
EXPECT_TRUE(file_system.Remove(wild_card_path)); EXPECT_TRUE(file_system.Remove(wild_card_path));