diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2018-09-02 13:58:42 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2018-09-02 13:58:42 -0700 |
commit | b6a92a93c619e012b2f57640495cc48809e89860 (patch) | |
tree | 53bd5cba71843f3b7982b47b9a6e575ff2065c70 /tests | |
parent | b7cad62b5f4a7f5fd2b4337bbdeae54132d9a8ae (diff) |
More work on CMake build, and updated conformance for proto3.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conformance_upb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/conformance_upb.c b/tests/conformance_upb.c index 5c0ce88..ea5365c 100644 --- a/tests/conformance_upb.c +++ b/tests/conformance_upb.c @@ -39,6 +39,10 @@ void CheckedWrite(int fd, const void *buf, size_t len) { } } +bool stringview_eql(upb_stringview view, const char *str) { + return view.size == strlen(str) && memcmp(view.data, str, view.size) == 0; +} + static const char *proto3_msg = "protobuf_test_messages.proto3.TestAllTypesProto3"; @@ -48,7 +52,7 @@ void DoTest( upb_env *env) { upb_stringview message_type = conformance_ConformanceRequest_message_type(request); - if (strcmp(message_type.data, proto3_msg) != 0) { + if (!stringview_eql(message_type, proto3_msg)) { static const char msg[] = "Only proto3 for now."; conformance_ConformanceResponse_set_skipped( response, upb_stringview_make(msg, sizeof(msg))); |