aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/security/base64_test.c
diff options
context:
space:
mode:
authorGravatar Ronnie Sahlberg <ronniesahlberg@gmail.com>2015-03-07 08:39:22 -0800
committerGravatar Ronnie Sahlberg <ronniesahlberg@gmail.com>2015-03-07 08:39:22 -0800
commit2ad8d21158df8b9a7e37b0a966f76b52a61f25e6 (patch)
treee1a64c2292d313ca08dea9288c7fc55b108b0db2 /test/core/security/base64_test.c
parent3631e82c890de1ff0382ab3062b2d05193604046 (diff)
strcmp: change all !str[n]cmp to str[n]cmp == 0
Change all !str[n]cmp to be str[n]cmp == 0 consistently across the codebase. Issue #231 Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Diffstat (limited to 'test/core/security/base64_test.c')
-rw-r--r--test/core/security/base64_test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/core/security/base64_test.c b/test/core/security/base64_test.c
index bfd5c48777..a922896bc3 100644
--- a/test/core/security/base64_test.c
+++ b/test/core/security/base64_test.c
@@ -58,8 +58,8 @@ static void test_simple_encode_decode_b64(int url_safe, int multiline) {
grpc_base64_encode(hello, strlen(hello), url_safe, multiline);
gpr_slice hello_slice = grpc_base64_decode(hello_b64, url_safe);
GPR_ASSERT(GPR_SLICE_LENGTH(hello_slice) == strlen(hello));
- GPR_ASSERT(!strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello,
- GPR_SLICE_LENGTH(hello_slice)));
+ GPR_ASSERT(strncmp((const char *)GPR_SLICE_START_PTR(hello_slice), hello,
+ GPR_SLICE_LENGTH(hello_slice)) == 0);
gpr_slice_unref(hello_slice);
gpr_free(hello_b64);
@@ -141,31 +141,31 @@ static void test_rfc4648_test_vectors(void) {
char *b64;
b64 = grpc_base64_encode("", 0, 0, 0);
- GPR_ASSERT(!strcmp("", b64));
+ GPR_ASSERT(strcmp("", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("f", 1, 0, 0);
- GPR_ASSERT(!strcmp("Zg==", b64));
+ GPR_ASSERT(strcmp("Zg==", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("fo", 2, 0, 0);
- GPR_ASSERT(!strcmp("Zm8=", b64));
+ GPR_ASSERT(strcmp("Zm8=", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("foo", 3, 0, 0);
- GPR_ASSERT(!strcmp("Zm9v", b64));
+ GPR_ASSERT(strcmp("Zm9v", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("foob", 4, 0, 0);
- GPR_ASSERT(!strcmp("Zm9vYg==", b64));
+ GPR_ASSERT(strcmp("Zm9vYg==", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("fooba", 5, 0, 0);
- GPR_ASSERT(!strcmp("Zm9vYmE=", b64));
+ GPR_ASSERT(strcmp("Zm9vYmE=", b64) == 0);
gpr_free(b64);
b64 = grpc_base64_encode("foobar", 6, 0, 0);
- GPR_ASSERT(!strcmp("Zm9vYmFy", b64));
+ GPR_ASSERT(strcmp("Zm9vYmFy", b64) == 0);
gpr_free(b64);
}