[VOL-1787] :
This commit sets up a unit-test framework for openolt
agent based on gtest, gmock and c-mock utilities.
A sample unit-test case to test EnableOlt success case is also
added. More test cases will be added in future commit.
Change-Id: If020be489a04d97df5fcbc15e9207deeee2fcfac
diff --git a/agent/src/stats_collection.cc b/agent/src/stats_collection.cc
index 693c782..2d535cf 100644
--- a/agent/src/stats_collection.cc
+++ b/agent/src/stats_collection.cc
@@ -77,13 +77,14 @@
openolt::PortStatistics* collectPortStatistics(bcmolt_intf_ref intf_ref) {
+ openolt::PortStatistics* port_stats = get_default_port_statistics();
+#ifndef TEST_MODE
bcmos_errno err;
bcmolt_stat_flags clear_on_read = BCMOLT_STAT_FLAGS_NONE;
bcmolt_nni_interface_stats nni_stats;
bcmolt_onu_itu_pon_stats pon_stats;
bcmolt_pon_interface_itu_pon_stats itu_pon_stats;
- openolt::PortStatistics* port_stats = get_default_port_statistics();
switch (intf_ref.intf_type) {
case BCMOLT_INTERFACE_TYPE_NNI:
@@ -177,7 +178,7 @@
time_t now;
time(&now);
port_stats->set_timestamp((int)now);
-
+#endif
return port_stats;
}