Loading lib/base64.c +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ CURLcode Curl_base64_encode(struct SessionHandle *data, * * When encoded data length is 0, returns NULL in *outptr. * * @unittest: * @unittest: 1302 */ CURLcode Curl_base64url_encode(struct SessionHandle *data, const char *inputbuff, size_t insize, Loading tests/unit/unit1302.c +19 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -73,6 +73,24 @@ fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); rc = Curl_base64_encode(data, "\xff\x01\xfe\x02", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "/wH+Ag==", 8); Curl_safefree(output); rc = Curl_base64url_encode(data, "\xff\x01\xfe\x02", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "_wH-Ag==", 8); Curl_safefree(output); rc = Curl_base64url_encode(data, "iiii", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); /* 0 length makes it do strlen() */ rc = Curl_base64_encode(data, "iiii", 0, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); Loading Loading
lib/base64.c +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ CURLcode Curl_base64_encode(struct SessionHandle *data, * * When encoded data length is 0, returns NULL in *outptr. * * @unittest: * @unittest: 1302 */ CURLcode Curl_base64url_encode(struct SessionHandle *data, const char *inputbuff, size_t insize, Loading
tests/unit/unit1302.c +19 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -73,6 +73,24 @@ fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); rc = Curl_base64_encode(data, "\xff\x01\xfe\x02", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "/wH+Ag==", 8); Curl_safefree(output); rc = Curl_base64url_encode(data, "\xff\x01\xfe\x02", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "_wH-Ag==", 8); Curl_safefree(output); rc = Curl_base64url_encode(data, "iiii", 4, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); fail_unless(size == 8, "size should be 8"); verify_memory( output, "aWlpaQ==", 8); Curl_safefree(output); /* 0 length makes it do strlen() */ rc = Curl_base64_encode(data, "iiii", 0, &output, &size); fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); Loading