Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: services/files/c/tests/test_utils_unittest.cc

Issue 1133933002: Move //services/files/c -> //mojo/services/files/public/c. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove data dep Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/files/c/tests/test_utils.cc ('k') | services/files/c/tests/util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/files/c/tests/test_utils_unittest.cc
diff --git a/services/files/c/tests/test_utils_unittest.cc b/services/files/c/tests/test_utils_unittest.cc
deleted file mode 100644
index 51cba81544cec2285ba387ac15168582f40031ec..0000000000000000000000000000000000000000
--- a/services/files/c/tests/test_utils_unittest.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "services/files/c/tests/test_utils.h"
-
-#include <errno.h>
-
-#include "services/files/c/tests/mock_errno_impl.h"
-#include "services/files/c/tests/mojio_impl_test_base.h"
-#include "services/files/c/tests/test_utils.h"
-
-namespace mojio {
-namespace test {
-namespace {
-
-using TestUtilsTest = mojio::test::MojioImplTestBase;
-
-TEST_F(TestUtilsTest, MakeDirAt) {
- EXPECT_EQ(-1, GetFileSize(&directory(), "my_file"));
- EXPECT_EQ(-1, GetFileSize(&directory(), "my_dir/my_file"));
-
- MakeDirAt(&directory(), "my_dir");
-
- EXPECT_EQ(-1, GetFileSize(&directory(), "my_file"));
- EXPECT_EQ(-1, GetFileSize(&directory(), "my_dir/my_file"));
-
- CreateTestFileAt(&directory(), "my_dir/my_file", 123);
-
- EXPECT_EQ(-1, GetFileSize(&directory(), "my_file"));
- EXPECT_EQ(123, GetFileSize(&directory(), "my_dir/my_file"));
-}
-
-TEST_F(TestUtilsTest, OpenFileAt) {
- EXPECT_FALSE(
- OpenFileAt(&directory(), "nonexistent", mojo::files::kOpenFlagWrite));
- EXPECT_TRUE(
- OpenFileAt(&directory(), "created",
- mojo::files::kOpenFlagWrite | mojo::files::kOpenFlagCreate));
- EXPECT_TRUE(OpenFileAt(&directory(), "created", mojo::files::kOpenFlagRead));
-}
-
-TEST_F(TestUtilsTest, CreateTestFileAtGetFileSizeGetFileContents) {
- CreateTestFileAt(&directory(), "file_0", 0);
- CreateTestFileAt(&directory(), "file_123", 123);
- CreateTestFileAt(&directory(), "file_456", 456);
-
- EXPECT_EQ(0, GetFileSize(&directory(), "file_0"));
- EXPECT_EQ(123, GetFileSize(&directory(), "file_123"));
- EXPECT_EQ(456, GetFileSize(&directory(), "file_456"));
- EXPECT_EQ(-1, GetFileSize(&directory(), "nonexistent"));
-
- EXPECT_EQ(std::string(), GetFileContents(&directory(), "file_0"));
-
- std::string s_123(123, '\0');
- for (size_t i = 0; i < 123; i++) {
- unsigned char c = static_cast<unsigned char>(i);
- s_123[i] = *reinterpret_cast<char*>(&c);
- }
- EXPECT_EQ(s_123, GetFileContents(&directory(), "file_123"));
-
- std::string s_456(456, '\0');
- for (size_t i = 0; i < 456; i++) {
- unsigned char c = static_cast<unsigned char>(i);
- s_456[i] = *reinterpret_cast<char*>(&c);
- }
- EXPECT_EQ(s_456, GetFileContents(&directory(), "file_456"));
-}
-
-} // namespace
-} // namespace test
-} // namespace mojio
« no previous file with comments | « services/files/c/tests/test_utils.cc ('k') | services/files/c/tests/util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698