Skip to content

Commit

Permalink
undo changes for mock tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shi Su committed Jun 23, 2021
1 parent 539b8fa commit 9c20c00
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
8 changes: 2 additions & 6 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ void BufferOrch::initBufferConstants()
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to get Maximum memory size, rv:%d", status);
task_process_status handle_status = handleSaiGetStatus(SAI_API_SWITCH, status);
if (handle_status != task_process_status::task_success)
{
// This is not a mandatory attribute so in case of failure we just return
return;
}
// This is not a mandatory attribute so in case of failure we just return
return;
}

vector<FieldValueTuple> fvVector;
Expand Down
4 changes: 0 additions & 4 deletions orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,7 @@ task_process_status Orch::handleSaiGetStatus(sai_api_t api, sai_status_t status,
case SAI_STATUS_NOT_IMPLEMENTED:
SWSS_LOG_ERROR("Encountered failure in get operation due to the function is not implemented, exiting orchagent, SAI API: %s",
sai_serialize_api(api).c_str());
#ifdef MOCK_TEST
exit(EXIT_FAILURE);
#else
break;
#endif
default:
SWSS_LOG_ERROR("Encountered failure in get operation, SAI API: %s, status: %s",
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
Expand Down
12 changes: 2 additions & 10 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3994,11 +3994,7 @@ void PortsOrch::initializePortMaximumHeadroom(Port &port)
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_NOTICE("Unable to get the maximum headroom for port %s rv:%d, ignored", port.m_alias.c_str(), status);
task_process_status handle_status = handleSaiGetStatus(SAI_API_PORT, status);
if (handle_status != task_process_status::task_success)
{
return;
}
return;
}

vector<FieldValueTuple> fvVector;
Expand Down Expand Up @@ -5918,11 +5914,7 @@ bool PortsOrch::getSystemPorts()
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_INFO("Failed to get number of system ports, rv:%d", status);
task_process_status handle_status = handleSaiGetStatus(SAI_API_SWITCH, status);
if (handle_status != task_process_status::task_success)
{
return parseHandleSaiStatusFailure(handle_status);
}
return false;
}

m_systemPortCount = attr.value.u32;
Expand Down
2 changes: 0 additions & 2 deletions tests/mock_tests/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

#define private public
#define protected public
#define MOCK_TEST

#include "aclorch.h"
#include "crmorch.h"

#undef protected
#undef private
#undef MOCK_TEST

struct Portal
{
Expand Down

0 comments on commit 9c20c00

Please sign in to comment.