diff options
author | Craig Tiller <ctiller@google.com> | 2017-01-10 06:48:34 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-01-10 06:48:34 -0800 |
commit | 2e900b1fe36d9b2693400b26fafd0891c9de3f00 (patch) | |
tree | e2ad4c4ec559dad83739776bd4e684f46026feac /test/core/bad_client | |
parent | 8f24d6a8d21dd05dd3fd4d90acabfaab38e65cbc (diff) |
Fix large metadata test - it was previously overconstrained now that we return better status
Diffstat (limited to 'test/core/bad_client')
-rw-r--r-- | test/core/bad_client/tests/large_metadata.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/test/core/bad_client/tests/large_metadata.c b/test/core/bad_client/tests/large_metadata.c index 2a0a56950b..f672776a9f 100644 --- a/test/core/bad_client/tests/large_metadata.c +++ b/test/core/bad_client/tests/large_metadata.c @@ -188,29 +188,26 @@ static void client_validator(grpc_slice_buffer *incoming) { grpc_slice_buffer_trim_end(incoming, 13, &last_frame_buffer); GPR_ASSERT(last_frame_buffer.count == 1); grpc_slice last_frame = last_frame_buffer.slices[0]; - // Construct expected frame. - grpc_slice expected = grpc_slice_malloc(13); - uint8_t *p = GRPC_SLICE_START_PTR(expected); - // Length. - *p++ = 0; - *p++ = 0; - *p++ = 4; - // Frame type (RST_STREAM). - *p++ = 3; - // Flags. - *p++ = 0; + const uint8_t *p = GRPC_SLICE_START_PTR(last_frame); + // Length = 4 + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 4); + // Frame type (RST_STREAM) + GPR_ASSERT(*p++ == 3); + // Flags + GPR_ASSERT(*p++ == 0); // Stream ID. - *p++ = 0; - *p++ = 0; - *p++ = 0; - *p++ = 1; - // Payload (error code). - *p++ = 0; - *p++ = 0; - *p++ = 0; - *p++ = 11; - // Compare actual and expected. - GPR_ASSERT(grpc_slice_eq(last_frame, expected)); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 1); + // Payload (error code) + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p++ == 0); + GPR_ASSERT(*p == 0 || *p == 11); + grpc_slice_buffer_destroy(&last_frame_buffer); } |