From 5405a3115bf4d242a6b6051818e4e42bc53e80fd Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 20 Jun 2015 08:53:24 +0200 Subject: [PATCH] src/utils_oauth_test.c: Fix oauth_create_google_json test. --- src/utils_oauth_test.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils_oauth_test.c b/src/utils_oauth_test.c index 09c46e1d..6087344b 100644 --- a/src/utils_oauth_test.c +++ b/src/utils_oauth_test.c @@ -117,21 +117,26 @@ DEF_TEST(oauth_create_google_json) { "\"client_x509_cert_url\":\"https://www.googleapis.com/robot/v1/" "metadata/x509/example-sacct%40ssc-serv-dev.iam.gserviceaccount.com\"}"; - oauth_t *ret = + oauth_google_t ret = oauth_create_google_json(in, "https://collectd.org/example.scope"); - CHECK_NOT_NULL(ret); + EXPECT_EQ_STR("collectd.org:unit-test", ret.project_id); + + CHECK_NOT_NULL(ret.oauth); struct { char *url; char *iss; char *aud; char *scope; - } *obj = (void *)ret; + } *obj = (void *)ret.oauth; EXPECT_EQ_STR("https://accounts.google.com/o/oauth2/token", obj->url); EXPECT_EQ_STR("example-sacct@unit-test.iam.gserviceaccount.com", obj->iss); EXPECT_EQ_STR("https://collectd.org/example.scope", obj->scope); + free(ret.project_id); + oauth_destroy(ret.oauth); + return 0; } -- 2.11.0