summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-09-02 13:58:42 -0700
committerJoshua Haberman <jhaberman@gmail.com>2018-09-02 13:58:42 -0700
commitb6a92a93c619e012b2f57640495cc48809e89860 (patch)
tree53bd5cba71843f3b7982b47b9a6e575ff2065c70 /tests
parentb7cad62b5f4a7f5fd2b4337bbdeae54132d9a8ae (diff)
More work on CMake build, and updated conformance for proto3.
Diffstat (limited to 'tests')
-rw-r--r--tests/conformance_upb.c6
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)));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback