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

Side by Side Diff: net/tools/dns_fuzz_stub/dns_fuzz_stub.cc

Issue 10527004: Make dns_fuzz_stub read and parse JSON test case (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <iostream> 6 #include <iostream>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (!ReadTestCase(filename, &id, &qname_dotted, &qtype, &resp_buf)) { 155 if (!ReadTestCase(filename, &id, &qname_dotted, &qtype, &resp_buf)) {
156 LOG(ERROR) << "Test case format invalid"; 156 LOG(ERROR) << "Test case format invalid";
157 return 2; 157 return 2;
158 } 158 }
159 159
160 LOG(INFO) << "Query: id=" << id 160 LOG(INFO) << "Query: id=" << id
161 << " qname=" << qname_dotted 161 << " qname=" << qname_dotted
162 << " qtype=" << qtype; 162 << " qtype=" << qtype;
163 LOG(INFO) << "Response: " << resp_buf.size() << " bytes"; 163 LOG(INFO) << "Response: " << resp_buf.size() << " bytes";
164 164
165 if (strcmp("pleasecrash", qname_dotted.c_str()) == 0) {
166 int *p = NULL;
167 *p = 0;
168 }
169
165 std::string qname; 170 std::string qname;
166 if (!net::DNSDomainFromDot(qname_dotted, &qname)) { 171 if (!net::DNSDomainFromDot(qname_dotted, &qname)) {
167 LOG(ERROR) << "DNSDomainFromDot(" << qname_dotted << ") failed."; 172 LOG(ERROR) << "DNSDomainFromDot(" << qname_dotted << ") failed.";
168 return 3; 173 return 3;
169 } 174 }
170 175
171 RunTestCase(id, qname, qtype, resp_buf); 176 RunTestCase(id, qname, qtype, resp_buf);
172 177
173 std::cout << "#EOF" << std::endl; 178 std::cout << "#EOF" << std::endl;
174 179
175 return 0; 180 return 0;
176 } 181 }
177 182
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698