/*------------------------------------------------------------------ * test_strcmpfld_s * * *------------------------------------------------------------------ */ #include "test_private.h" #include "safe_str_lib.h" #define MAX ( 128 ) #define LEN ( 128 ) int test_strcmpfld_s() { errno_t rc; uint32_t i; rsize_t len; int ind; char str1[LEN]; char str2[LEN]; /*--------------------------------------------------*/ rc = strcmpfld_s(NULL, LEN, str2, &ind); if (rc != ESNULLP) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ len = 5; rc = strcmpfld_s(str1, len, NULL, &ind); if (rc != ESNULLP) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ len = 5; rc = strcmpfld_s(str1, len, str2, NULL); if (rc != ESNULLP) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ rc = strcmpfld_s(str1, 0, str2, &ind); if (rc != ESZEROL) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ rc = strcmpfld_s(str1, (RSIZE_MAX_STR+1), str2, &ind); if (rc != ESLEMAX) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } /*--------------------------------------------------*/ /*--------------------------------------------------*/ strcpy(str1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); strcpy(str2, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); len = 1; rc = strcmpfld_s(str1, len, str2, &ind); if (rc != EOK) { debug_printf("%s %u Error rc=%u \n", __FUNCTION__, __LINE__, rc ); } for (i=0; i