/*------------------------------------------------------------------ * test_strzero_s * * *------------------------------------------------------------------ */ #include "test_private.h" #include "safe_str_lib.h" #define LEN ( 128 ) int test_strzero_s() { errno_t rc; rsize_t max_len; char str1[LEN]; uint32_t i; /*--------------------------------------------------*/ rc = strzero_s(NULL, 5); if (rc != ESNULLP) { printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ rc = strzero_s(str1, 0); if (rc != ESZEROL) { printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ rc = strzero_s(str1, RSIZE_MAX_STR+1); if (rc != ESLEMAX) { printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ max_len = 1; rc = strzero_s(str1, max_len); if (rc != EOK) { printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } for (i=0; i