OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 15 matching lines...) Expand all Loading... |
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
31 #include <errno.h> | 31 #include <errno.h> |
32 #include <stdarg.h> | 32 #include <stdarg.h> |
33 #include <unistd.h> | 33 #include <unistd.h> |
34 | 34 |
35 #include "conformance.pb.h" | 35 #include "conformance.pb.h" |
36 #include <google/protobuf/test_messages_proto3.pb.h> | |
37 #include <google/protobuf/util/json_util.h> | 36 #include <google/protobuf/util/json_util.h> |
38 #include <google/protobuf/util/type_resolver_util.h> | 37 #include <google/protobuf/util/type_resolver_util.h> |
39 | 38 |
40 using conformance::ConformanceRequest; | 39 using conformance::ConformanceRequest; |
41 using conformance::ConformanceResponse; | 40 using conformance::ConformanceResponse; |
| 41 using conformance::TestAllTypes; |
42 using google::protobuf::Descriptor; | 42 using google::protobuf::Descriptor; |
43 using google::protobuf::DescriptorPool; | 43 using google::protobuf::DescriptorPool; |
44 using google::protobuf::internal::scoped_ptr; | 44 using google::protobuf::internal::scoped_ptr; |
45 using google::protobuf::util::BinaryToJsonString; | 45 using google::protobuf::util::BinaryToJsonString; |
46 using google::protobuf::util::JsonToBinaryString; | 46 using google::protobuf::util::JsonToBinaryString; |
47 using google::protobuf::util::NewTypeResolverForDescriptorPool; | 47 using google::protobuf::util::NewTypeResolverForDescriptorPool; |
48 using google::protobuf::util::Status; | 48 using google::protobuf::util::Status; |
49 using google::protobuf::util::TypeResolver; | 49 using google::protobuf::util::TypeResolver; |
50 using protobuf_test_messages::proto3::TestAllTypes; | |
51 using std::string; | 50 using std::string; |
52 | 51 |
53 static const char kTypeUrlPrefix[] = "type.googleapis.com"; | 52 static const char kTypeUrlPrefix[] = "type.googleapis.com"; |
54 | 53 |
55 static string GetTypeUrl(const Descriptor* message) { | 54 static string GetTypeUrl(const Descriptor* message) { |
56 return string(kTypeUrlPrefix) + "/" + message->full_name(); | 55 return string(kTypeUrlPrefix) + "/" + message->full_name(); |
57 } | 56 } |
58 | 57 |
59 int test_count = 0; | 58 int test_count = 0; |
60 bool verbose = false; | 59 bool verbose = false; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 kTypeUrlPrefix, DescriptorPool::generated_pool()); | 198 kTypeUrlPrefix, DescriptorPool::generated_pool()); |
200 type_url = new string(GetTypeUrl(TestAllTypes::descriptor())); | 199 type_url = new string(GetTypeUrl(TestAllTypes::descriptor())); |
201 while (1) { | 200 while (1) { |
202 if (!DoTestIo()) { | 201 if (!DoTestIo()) { |
203 fprintf(stderr, "conformance-cpp: received EOF from test runner " | 202 fprintf(stderr, "conformance-cpp: received EOF from test runner " |
204 "after %d tests, exiting\n", test_count); | 203 "after %d tests, exiting\n", test_count); |
205 return 0; | 204 return 0; |
206 } | 205 } |
207 } | 206 } |
208 } | 207 } |
OLD | NEW |