Skip to content

Commit

Permalink
Add ResourceLimiterParser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Aug 23, 2021
1 parent f6b35da commit 467e228
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions unittest/vslib/TestResourceLimiterParser.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "ResourceLimiterParser.h"

#include <gtest/gtest.h>

using namespace saivs;

TEST(ResourceLimiterParser, parseFromFile)
{
EXPECT_NE(ResourceLimiterParser::parseFromFile(nullptr), nullptr);

EXPECT_NE(ResourceLimiterParser::parseFromFile("not_existing"), nullptr);

EXPECT_NE(ResourceLimiterParser::parseFromFile("files/resource_limiter_bad.txt"), nullptr);

EXPECT_NE(ResourceLimiterParser::parseFromFile("files/resource_limiter_ok.txt"), nullptr);

auto rlc = ResourceLimiterParser::parseFromFile("files/resource_limiter_ok.txt");

auto rl = rlc->getResourceLimiter(1);

EXPECT_NE(rl, nullptr);

EXPECT_EQ(rl->getObjectTypeLimit(SAI_OBJECT_TYPE_PORT), 8);
}

0 comments on commit 467e228

Please sign in to comment.