blob: 4c38ab05f227d39ce153ba727616190fda26f1f5 [file] [log] [blame]
Paul Bakker33b43f12013-08-20 11:48:36 +02001/* BEGIN_HEADER */
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +00002#include "mbedtls/error.h"
Paul Bakker33b43f12013-08-20 11:48:36 +02003/* END_HEADER */
Paul Bakker9d781402011-05-09 16:17:09 +00004
Paul Bakker33b43f12013-08-20 11:48:36 +02005/* BEGIN_DEPENDENCIES
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +02006 * depends_on:MBEDTLS_ERROR_C
Paul Bakker33b43f12013-08-20 11:48:36 +02007 * END_DEPENDENCIES
8 */
Paul Bakker5690efc2011-05-26 13:16:06 +00009
Paul Bakker33b43f12013-08-20 11:48:36 +020010/* BEGIN_CASE */
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020011void error_strerror(int code, char *result_str)
Paul Bakker9d781402011-05-09 16:17:09 +000012{
13 char buf[500];
14
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020015 memset(buf, 0, sizeof(buf));
Manuel Pégourié-Gonnard52a555c2014-03-27 18:49:32 +010016
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020017 mbedtls_strerror(code, buf, 500);
Paul Bakker9d781402011-05-09 16:17:09 +000018
Mateusz Starzykc0eabdc2021-08-03 14:09:02 +020019 TEST_ASSERT(strcmp(buf, result_str) == 0);
Paul Bakker9d781402011-05-09 16:17:09 +000020}
Paul Bakker33b43f12013-08-20 11:48:36 +020021/* END_CASE */