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

Unified Diff: minidump/minidump_string_writer_test_util.cc

Issue 663093003: Move minidump/*_test_util.* to minidump/test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 2 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 | « minidump/minidump_string_writer_test_util.h ('k') | minidump/minidump_system_info_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_string_writer_test_util.cc
diff --git a/minidump/minidump_string_writer_test_util.cc b/minidump/minidump_string_writer_test_util.cc
deleted file mode 100644
index 7914c68ab5c31d6048e516ec5dedc9d504615bf6..0000000000000000000000000000000000000000
--- a/minidump/minidump_string_writer_test_util.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Crashpad Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "minidump/minidump_string_writer_test_util.h"
-
-#include "gtest/gtest.h"
-#include "minidump/minidump_extensions.h"
-
-namespace crashpad {
-namespace test {
-
-std::string MinidumpUTF8StringAtRVA(const StringFileWriter& file_writer,
- RVA rva) {
- const std::string& contents = file_writer.string();
- if (rva == 0) {
- return std::string();
- }
-
- if (rva + sizeof(MinidumpUTF8String) > contents.size()) {
- ADD_FAILURE()
- << "rva " << rva << " too large for contents " << contents.size();
- return std::string();
- }
-
- const MinidumpUTF8String* minidump_string =
- reinterpret_cast<const MinidumpUTF8String*>(&contents[rva]);
-
- // Verify that the file has enough data for the string’s stated length plus
- // its required NUL terminator.
- if (rva + sizeof(MinidumpUTF8String) + minidump_string->Length + 1 >
- contents.size()) {
- ADD_FAILURE()
- << "rva " << rva << ", length " << minidump_string->Length
- << " too large for contents " << contents.size();
- return std::string();
- }
-
- std::string minidump_string_data(
- reinterpret_cast<const char*>(&minidump_string->Buffer[0]),
- minidump_string->Length);
- return minidump_string_data;
-}
-
-} // namespace test
-} // namespace crashpad
« no previous file with comments | « minidump/minidump_string_writer_test_util.h ('k') | minidump/minidump_system_info_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698