Skip to content

Commit

Permalink
[orchagent]: Implement test_profile_get_next_value() (sonic-net#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluo-msft authored and Shuotian Cheng committed May 26, 2017
1 parent 0342846 commit 83e46ba
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,28 @@ int test_profile_get_next_value (
{
SWSS_LOG_ENTER();

return -1;
static auto it = gProfileMap.begin();

if (value == NULL)
{
// Restarts enumeration
it = gProfileMap.begin();
}
else if (it == gProfileMap.end())
{
return -1;
}
else
{
*variable = it->first.c_str();
*value = it->second.c_str();
it++;
}

if (it != gProfileMap.end())
return 0;
else
return -1;
}

const service_method_table_t test_services = {
Expand Down

0 comments on commit 83e46ba

Please sign in to comment.