diff options
author | Julien Boeuf <jboeuf@google.com> | 2016-11-17 16:59:48 -0800 |
---|---|---|
committer | Julien Boeuf <jboeuf@google.com> | 2016-12-21 22:04:36 -0800 |
commit | 964d7bb4828461f4c4d51cfe7f774367fc162013 (patch) | |
tree | a633b1766d1e93e614dc0d5b420668260a489ff6 /test/core/support | |
parent | c3c1240ad5e2e7b3b25c28639ad8cf5152b19f33 (diff) |
Fixing JWT verifier.
- Initializes grpc correctly in the JWT utils.
- Make the email mapping work with the new service accounts produced by
Google IAM.
- Adding check for email issuers where the issuer has to be the subject as well.
- Implementing portable version of memrchr.
Diffstat (limited to 'test/core/support')
-rw-r--r-- | test/core/support/string_test.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c index 78b77fad8e..af232db350 100644 --- a/test/core/support/string_test.c +++ b/test/core/support/string_test.c @@ -243,6 +243,8 @@ static void test_int64toa() { static void test_leftpad() { char *padded; + LOG_TEST_NAME("test_leftpad"); + padded = gpr_leftpad("foo", ' ', 5); GPR_ASSERT(0 == strcmp(" foo", padded)); gpr_free(padded); @@ -273,12 +275,25 @@ static void test_leftpad() { } static void test_stricmp(void) { + LOG_TEST_NAME("test_stricmp"); + GPR_ASSERT(0 == gpr_stricmp("hello", "hello")); GPR_ASSERT(0 == gpr_stricmp("HELLO", "hello")); GPR_ASSERT(gpr_stricmp("a", "b") < 0); GPR_ASSERT(gpr_stricmp("b", "a") > 0); } +static void test_memrchr(void) { + LOG_TEST_NAME("test_memrchr"); + + GPR_ASSERT(NULL == gpr_memrchr(NULL, 'a', 0)); + GPR_ASSERT(NULL == gpr_memrchr("", 'a', 0)); + GPR_ASSERT(NULL == gpr_memrchr("hello", 'b', 5)); + GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'h', 5), "hello")); + GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'o', 5), "o")); + GPR_ASSERT(0 == strcmp((const char *)gpr_memrchr("hello", 'l', 5), "lo")); +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); test_strdup(); @@ -291,5 +306,6 @@ int main(int argc, char **argv) { test_int64toa(); test_leftpad(); test_stricmp(); + test_memrchr(); return 0; } |