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 <sstream> | 6 #include <sstream> |
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 if (!response.InitParse(resp_buf.size(), query)) { | 143 if (!response.InitParse(resp_buf.size(), query)) { |
144 LOG(INFO) << "InitParse failed."; | 144 LOG(INFO) << "InitParse failed."; |
145 return; | 145 return; |
146 } | 146 } |
147 | 147 |
148 net::AddressList address_list; | 148 net::AddressList address_list; |
149 base::TimeDelta ttl; | 149 base::TimeDelta ttl; |
150 net::DnsResponse::Result result = response.ParseToAddressList( | 150 net::DnsResponse::Result result = response.ParseToAddressList( |
151 &address_list, &ttl); | 151 &address_list, &ttl); |
152 if (result != net::DnsResponse::DNS_SUCCESS) { | 152 if (result != net::DnsResponse::DNS_PARSE_OK) { |
153 LOG(INFO) << "ParseToAddressList failed: " << result; | 153 LOG(INFO) << "ParseToAddressList failed: " << result; |
154 return; | 154 return; |
155 } | 155 } |
156 | 156 |
157 // Print the response in one compact line. | 157 // Print the response in one compact line. |
158 std::stringstream result_line; | 158 std::stringstream result_line; |
159 result_line << "Response: address_list={ "; | 159 result_line << "Response: address_list={ "; |
160 for (unsigned int i = 0; i < address_list.size(); i++) | 160 for (unsigned int i = 0; i < address_list.size(); i++) |
161 result_line << address_list[i].ToString() << " "; | 161 result_line << address_list[i].ToString() << " "; |
162 result_line << "}, ttl=" << ttl.InSeconds() << "s"; | 162 result_line << "}, ttl=" << ttl.InSeconds() << "s"; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (!ReadAndRunTestCase(argv[i])) | 206 if (!ReadAndRunTestCase(argv[i])) |
207 ret = 2; | 207 ret = 2; |
208 | 208 |
209 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish | 209 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish |
210 // successful runs from crashes. | 210 // successful runs from crashes. |
211 printf("#EOF\n"); | 211 printf("#EOF\n"); |
212 | 212 |
213 return ret; | 213 return ret; |
214 } | 214 } |
215 | 215 |
OLD | NEW |