1
0
mirror of https://github.com/yarrick/iodine.git synced 2024-11-25 22:46:05 +03:00

#3 updated encoding testcase to new usage

This commit is contained in:
Erik Ekman 2007-02-08 20:42:24 +00:00
parent 0e951ef007
commit a8127f410c

View File

@ -27,21 +27,19 @@ START_TEST(test_encoding_base32)
char temp[256];
char *start = "HELLOTEST";
char *out = "1HELLOTEST";
char *end;
char end[256];
char *tempend;
int codedlength;
memset(temp, 0, sizeof(temp));
end = malloc(16);
memset(end, 0, 16);
memset(end, 0, sizeof(end));
codedlength = encode_data(start, 9, 256, temp);
codedlength = encode_data(start, strlen(start), sizeof(temp) - 1, temp + 1);
temp[0] = '1';
tempend = temp + strlen(temp);
decode_data(end, 16, temp, tempend);
decode_data(end, sizeof(end), temp, tempend);
fail_unless(strcmp(out, end) == 0, NULL);
free(end);
}
END_TEST