OLD | NEW |
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 Loading... |
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 |
OLD | NEW |