2013-08-20 11:48:36 +02:00
|
|
|
/* BEGIN_HEADER */
|
2015-02-06 14:57:42 +01:00
|
|
|
#include "polarssl/error.h"
|
2013-08-20 11:48:36 +02:00
|
|
|
/* END_HEADER */
|
2011-05-09 18:17:09 +02:00
|
|
|
|
2013-08-20 11:48:36 +02:00
|
|
|
/* BEGIN_DEPENDENCIES
|
|
|
|
* depends_on:POLARSSL_ERROR_C
|
|
|
|
* END_DEPENDENCIES
|
|
|
|
*/
|
2011-05-26 15:16:06 +02:00
|
|
|
|
2013-08-20 11:48:36 +02:00
|
|
|
/* BEGIN_CASE */
|
|
|
|
void error_strerror( int code, char *result_str )
|
2011-05-09 18:17:09 +02:00
|
|
|
{
|
|
|
|
char buf[500];
|
|
|
|
|
2014-03-27 18:49:32 +01:00
|
|
|
memset( buf, 0, sizeof( buf ) );
|
|
|
|
|
2013-10-27 14:11:32 +01:00
|
|
|
polarssl_strerror( code, buf, 500 );
|
2011-05-09 18:17:09 +02:00
|
|
|
|
2013-08-20 11:48:36 +02:00
|
|
|
TEST_ASSERT( strcmp( buf, result_str ) == 0 );
|
2014-03-27 18:49:32 +01:00
|
|
|
|
|
|
|
#if defined(POLARSSL_ERROR_STRERROR_BC)
|
|
|
|
memset( buf, 0, sizeof( buf ) );
|
|
|
|
|
|
|
|
error_strerror( code, buf, 500 );
|
|
|
|
|
|
|
|
TEST_ASSERT( strcmp( buf, result_str ) == 0 );
|
|
|
|
#endif
|
2011-05-09 18:17:09 +02:00
|
|
|
}
|
2013-08-20 11:48:36 +02:00
|
|
|
/* END_CASE */
|