This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-service-chaining-…/platform/test/gtest_sf_metrics.cpp

32 lines
708 B
C++
Raw Normal View History

#include <gtest/gtest.h>
#include "sf_metrics.h"
TEST(SF_METRICS, TEST)
{
struct sf_metrics *metrics = sf_metrics_create("./test_resource/sce.conf");
EXPECT_TRUE(sf_metrics_get_interval(metrics) == 1);
struct sf_metrics_key key1 = {0};
key1.rule_id = 1;
key1.sff_profile_id = 2;
key1.sf_profile_id = 3;
key1.vsys_id = 4;
sf_metrics_inc(metrics, &key1, 4, 5, 6, 7);
struct sf_metrics_key key2 = {0};
key2.rule_id = 1;
key2.sff_profile_id = 2;
key2.sf_profile_id = 3;
key2.vsys_id = 4;
sf_metrics_inc(metrics, &key2, 4, 5, 6, 7);
sf_metrics_send(metrics);
sf_metrics_destory(metrics);
}
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}