| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 #endif | 131 #endif |
| 132 ASSERT_GT(resource.find(kTestName), 0u); | 132 ASSERT_GT(resource.find(kTestName), 0u); |
| 133 ASSERT_GT(resource.find(kExtension), 0u); | 133 ASSERT_GT(resource.find(kExtension), 0u); |
| 134 } | 134 } |
| 135 | 135 |
| 136 TEST_F(FileUtilsTest, GetFileSizeExistingFile) { | 136 TEST_F(FileUtilsTest, GetFileSizeExistingFile) { |
| 137 // Create a file with some dummy data in. | 137 // Create a file with some dummy data in. |
| 138 std::string temp_filename = webrtc::test::TempFilename( | 138 std::string temp_filename = webrtc::test::TempFilename( |
| 139 webrtc::test::OutputPath(), "fileutils_unittest"); | 139 webrtc::test::OutputPath(), "fileutils_unittest"); |
| 140 FILE* file = fopen(temp_filename.c_str(), "wb"); | 140 FILE* file = fopen(temp_filename.c_str(), "wb"); |
| 141 ASSERT_TRUE(file != NULL) << "Failed to open file: " << temp_filename; | 141 ASSERT_TRUE(file != nullptr) << "Failed to open file: " << temp_filename; |
| 142 ASSERT_GT(fprintf(file, "%s", "Dummy data"), 0) << | 142 ASSERT_GT(fprintf(file, "%s", "Dummy data"), 0) << |
| 143 "Failed to write to file: " << temp_filename; | 143 "Failed to write to file: " << temp_filename; |
| 144 fclose(file); | 144 fclose(file); |
| 145 ASSERT_GT(webrtc::test::GetFileSize(std::string(temp_filename.c_str())), 0u); | 145 ASSERT_GT(webrtc::test::GetFileSize(std::string(temp_filename.c_str())), 0u); |
| 146 remove(temp_filename.c_str()); | 146 remove(temp_filename.c_str()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 TEST_F(FileUtilsTest, GetFileSizeNonExistingFile) { | 149 TEST_F(FileUtilsTest, GetFileSizeNonExistingFile) { |
| 150 ASSERT_EQ(0u, webrtc::test::GetFileSize("non-existing-file.tmp")); | 150 ASSERT_EQ(0u, webrtc::test::GetFileSize("non-existing-file.tmp")); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace webrtc | 153 } // namespace webrtc |
| OLD | NEW |