zabbix-agent2/tests/zbxmockutil.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_mock_str_to_return_code                                      *
 *                                                                            *
 * Purpose: converts common function return code from text format             *
 *                                                                            *
 ******************************************************************************/
zbx_mock_str_to_return_code

Purpose: converts common function return code from text format
zbx_mock_str_to_return_code Purpose : converts common function return code from text format
int	zbx_mock_str_to_return_code(const char *str)
{
	if (0 == strcmp(str, "SUCCEED"))
		return SUCCEED;
	if (0 == strcmp(str, "FAIL"))
		return FAIL;
	if (0 == strcmp(str, "NOTSUPPORTED"))
		return NOTSUPPORTED;
	if (0 == strcmp(str, "NETWORK_ERROR"))
		return NETWORK_ERROR;
	if (0 == strcmp(str, "TIMEOUT_ERROR"))
		return TIMEOUT_ERROR;
	if (0 == strcmp(str, "AGENT_ERROR"))
		return AGENT_ERROR;
	if (0 == strcmp(str, "GATEWAY_ERROR"))
		return GATEWAY_ERROR;
	if (0 == strcmp(str, "CONFIG_ERROR"))
		return CONFIG_ERROR;
	if (0 == strcmp(str, "SYSINFO_RET_OK"))
		return SYSINFO_RET_OK;
	if (0 == strcmp(str, "SYSINFO_RET_FAIL"))
		return SYSINFO_RET_FAIL;
	fail_msg("Unknown return code  \"%s\"", str);
	return 0;
}
int zbx_mock_str_to_return_code ( const char * str ) { if ( 0 == strcmp ( str , " " ) ) return SUCCEED ; if ( 0 == strcmp ( str , " " ) ) return FAIL ; if ( 0 == strcmp ( str , " " ) ) return NOTSUPPORTED ; if ( 0 == strcmp ( str , " " ) ) return NETWORK_ERROR ; if ( 0 == strcmp ( str , " " ) ) return TIMEOUT_ERROR ; if ( 0 == strcmp ( str , " " ) ) return AGENT_ERROR ; if ( 0 == strcmp ( str , " " ) ) return GATEWAY_ERROR ; if ( 0 == strcmp ( str , " " ) ) return CONFIG_ERROR ; if ( 0 == strcmp ( str , " " ) ) return SYSINFO_RET_OK ; if ( 0 == strcmp ( str , " " ) ) return SYSINFO_RET_FAIL ; fail_msg ( " \" \" " , str ) ; return 0 ; }
Function: zbx_mock_str_to_return_code                                      
                                                                            
 Purpose: converts common function return code from text format
Function : zbx_mock_str_to_return_code Purpose : converts common function return code from text format