added polarssl-0.14.0

This commit is contained in:
NIIBE Yutaka
2010-08-30 09:45:41 +09:00
parent 4e397a033c
commit 0e2a614ed3
230 changed files with 43387 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
BEGIN_HEADER
#include <polarssl/base64.h>
END_HEADER
BEGIN_CASE
base64_encode:src_string:dst_string:dst_buf_size:result
{
unsigned char src_str[1000];
unsigned char dst_str[1000];
int len = {dst_buf_size};
memset(src_str, 0x00, 1000);
memset(dst_str, 0x00, 1000);
strcpy( (char *) src_str, {src_string} );
TEST_ASSERT( base64_encode( dst_str, &len, src_str, strlen( (char *) src_str ) ) == {result} );
if( {result} == 0 )
{
TEST_ASSERT( strcmp( (char *) dst_str, {dst_string} ) == 0 );
}
}
END_CASE
BEGIN_CASE
base64_decode:src_string:dst_string:result
{
unsigned char src_str[1000];
unsigned char dst_str[1000];
int len = 1000;
int res;
memset(src_str, 0x00, 1000);
memset(dst_str, 0x00, 1000);
strcpy( (char *) src_str, {src_string} );
TEST_ASSERT( res = base64_decode( dst_str, &len, src_str, strlen( (char *) src_str ) ) == {result} );
if( {result} == 0 )
{
TEST_ASSERT( strcmp( (char *) dst_str, {dst_string} ) == 0 );
}
}
END_CASE
BEGIN_CASE
base64_selftest:
{
TEST_ASSERT( base64_self_test( 0 ) == 0 );
}
END_CASE