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

Side by Side Diff: third_party/boringssl/boringssl_unittest.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « storage/browser/fileapi/file_system_url.cc ('k') | third_party/zlib/google/zip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdarg.h> 5 #include <stdarg.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 14 matching lines...) Expand all
25 exe_dir.AppendASCII("boringssl_" + name); 25 exe_dir.AppendASCII("boringssl_" + name);
26 base::CommandLine cmd(test_binary); 26 base::CommandLine cmd(test_binary);
27 27
28 for (size_t i = 0; i < args.size(); ++i) { 28 for (size_t i = 0; i < args.size(); ++i) {
29 cmd.AppendArgNative(args[i]); 29 cmd.AppendArgNative(args[i]);
30 } 30 }
31 31
32 std::string output; 32 std::string output;
33 EXPECT_TRUE(base::GetAppOutput(cmd, &output)); 33 EXPECT_TRUE(base::GetAppOutput(cmd, &output));
34 // Account for Windows line endings. 34 // Account for Windows line endings.
35 ReplaceSubstringsAfterOffset(&output, 0, "\r\n", "\n"); 35 base::ReplaceSubstringsAfterOffset(&output, 0, "\r\n", "\n");
36 36
37 const bool ok = output.size() >= 5 && 37 const bool ok = output.size() >= 5 &&
38 memcmp("PASS\n", &output[output.size() - 5], 5) == 0 && 38 memcmp("PASS\n", &output[output.size() - 5], 5) == 0 &&
39 (output.size() == 5 || output[output.size() - 6] == '\n'); 39 (output.size() == 5 || output[output.size() - 6] == '\n');
40 40
41 EXPECT_TRUE(ok) << output; 41 EXPECT_TRUE(ok) << output;
42 } 42 }
43 43
44 void TestSimple(const std::string& name) { 44 void TestSimple(const std::string& name) {
45 std::vector<base::CommandLine::StringType> empty; 45 std::vector<base::CommandLine::StringType> empty;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 TestSimple("tab_test"); 292 TestSimple("tab_test");
293 } 293 }
294 294
295 TEST(BoringSSL, Thread) { 295 TEST(BoringSSL, Thread) {
296 TestSimple("thread_test"); 296 TestSimple("thread_test");
297 } 297 }
298 298
299 TEST(BoringSSL, V3NameTest) { 299 TEST(BoringSSL, V3NameTest) {
300 TestSimple("v3name_test"); 300 TestSimple("v3name_test");
301 } 301 }
OLDNEW
« no previous file with comments | « storage/browser/fileapi/file_system_url.cc ('k') | third_party/zlib/google/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698