| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 EXPECT_EQ(4u, file.WriteAt(data, 4, 4)); | 157 EXPECT_EQ(4u, file.WriteAt(data, 4, 4)); |
| 158 EXPECT_EQ(4u, file.ReadAt(out, 4, 4)); | 158 EXPECT_EQ(4u, file.ReadAt(out, 4, 4)); |
| 159 EXPECT_TRUE(VerifyBuffer(out, 4, 0)); | 159 EXPECT_TRUE(VerifyBuffer(out, 4, 0)); |
| 160 | 160 |
| 161 EXPECT_EQ(2u, file.WriteAt(data, 2, 8)); | 161 EXPECT_EQ(2u, file.WriteAt(data, 2, 8)); |
| 162 EXPECT_EQ(2u, file.ReadAt(out, 2, 8)); | 162 EXPECT_EQ(2u, file.ReadAt(out, 2, 8)); |
| 163 EXPECT_TRUE(VerifyBuffer(out, 2, 0)); | 163 EXPECT_TRUE(VerifyBuffer(out, 2, 0)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 TEST_F(FileTest, OpenFromPathname) { |
| 167 { |
| 168 File file = File::Open(Pathname(path_)); |
| 169 ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError(); |
| 170 } |
| 171 |
| 172 { |
| 173 Pathname path(path_); |
| 174 File file = File::Open(path); |
| 175 ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError(); |
| 176 } |
| 177 } |
| 178 |
| 179 TEST_F(FileTest, CreateFromPathname) { |
| 180 { |
| 181 File file = File::Create(Pathname(path_)); |
| 182 ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError(); |
| 183 } |
| 184 |
| 185 { |
| 186 Pathname path(path_); |
| 187 File file = File::Create(path); |
| 188 ASSERT_TRUE(file.IsOpen()) << "Error: " << LastError(); |
| 189 } |
| 190 } |
| 191 |
| 166 } // namespace rtc | 192 } // namespace rtc |
| OLD | NEW |