From 62b8fddee1eabb66e757eab8ffa269b2b5bd5ec0 Mon Sep 17 00:00:00 2001 From: kcudnik Date: Mon, 13 Sep 2021 11:43:22 +0200 Subject: [PATCH] Add RedisVidIndexGenerator tests --- unittest/lib/Makefile.am | 3 ++- unittest/lib/TestRedisVidIndexGenerator.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 unittest/lib/TestRedisVidIndexGenerator.cpp diff --git a/unittest/lib/Makefile.am b/unittest/lib/Makefile.am index 4ed673bfc..2fd6f1d37 100644 --- a/unittest/lib/Makefile.am +++ b/unittest/lib/Makefile.am @@ -19,7 +19,8 @@ tests_SOURCES = \ TestSwitchContainer.cpp \ TestSwitchConfigContainer.cpp \ TestSkipRecordAttrContainer.cpp \ - TestServerConfig.cpp + TestServerConfig.cpp \ + TestRedisVidIndexGenerator.cpp tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/lib/libSaiRedis.a -lhiredis -lswsscommon -lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) diff --git a/unittest/lib/TestRedisVidIndexGenerator.cpp b/unittest/lib/TestRedisVidIndexGenerator.cpp new file mode 100644 index 000000000..368abe50e --- /dev/null +++ b/unittest/lib/TestRedisVidIndexGenerator.cpp @@ -0,0 +1,16 @@ +#include "RedisVidIndexGenerator.h" + +#include + +#include + +using namespace sairedis; + +TEST(RedisVidIndexGenerator, reset) +{ + auto db = std::make_shared("ASIC_DB", 0); + + RedisVidIndexGenerator g(db, "FOO"); + + g.reset(); +}