File: base64.c

package info (click to toggle)
gcli 2.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,476 kB
  • sloc: ansic: 25,411; sh: 580; makefile: 509; yacc: 261; lex: 59
file content (21 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <atf-c.h>

#include <gcli/base64.h>

ATF_TC_WITHOUT_HEAD(simple_decode);
ATF_TC_BODY(simple_decode, tc)
{
	char const input[] = "aGVsbG8gd29ybGQ=";
	char output[sizeof("hello world")] = {0};

	int rc = gcli_decode_base64(NULL, input, output, sizeof(output));
	ATF_REQUIRE(rc == 0);
	ATF_CHECK_STREQ(output, "hello world");
}

ATF_TP_ADD_TCS(tp)
{
	ATF_TP_ADD_TC(tp, simple_decode);

	return atf_no_error();
}