diff --git a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp index 2970503ff3..4d605ce30f 100644 --- a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp +++ b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp @@ -40,7 +40,7 @@ namespace bpf { using base::Result; -// The target map for stats reading should be the inactive map, which is oppsite +// The target map for stats reading should be the inactive map, which is opposite // from the config value. static constexpr char const* STATS_MAP_PATH[] = {STATS_MAP_B_PATH, STATS_MAP_A_PATH}; @@ -311,7 +311,7 @@ bool operator==(const stats_line& lhs, const stats_line& rhs) { !strncmp(lhs.iface, rhs.iface, sizeof(lhs.iface))); } -// True if lhs is smaller then rhs, only compare iface, uid, tag and set. +// True if lhs is smaller than rhs, only compare iface, uid, tag and set. bool operator<(const stats_line& lhs, const stats_line& rhs) { int ret = strncmp(lhs.iface, rhs.iface, sizeof(lhs.iface)); if (ret != 0) return ret < 0; diff --git a/service-t/native/libs/libnetworkstats/BpfNetworkStatsTest.cpp b/service-t/native/libs/libnetworkstats/BpfNetworkStatsTest.cpp index 03e6016065..4974b96d6b 100644 --- a/service-t/native/libs/libnetworkstats/BpfNetworkStatsTest.cpp +++ b/service-t/native/libs/libnetworkstats/BpfNetworkStatsTest.cpp @@ -58,7 +58,7 @@ constexpr uint64_t TEST_PACKET1 = 200; constexpr const char IFACE_NAME1[] = "lo"; constexpr const char IFACE_NAME2[] = "wlan0"; constexpr const char IFACE_NAME3[] = "rmnet_data0"; -// A iface name that the size is bigger then IFNAMSIZ +// A iface name that the size is bigger than IFNAMSIZ constexpr const char LONG_IFACE_NAME[] = "wlanWithALongName"; constexpr const char TRUNCATED_IFACE_NAME[] = "wlanWithALongNa"; constexpr uint32_t IFACE_INDEX1 = 1; @@ -351,7 +351,7 @@ TEST_F(BpfNetworkStatsHelperTest, TestGetStatsWithSkippedIface) { ASSERT_EQ((unsigned long)2, lines.size()); } -TEST_F(BpfNetworkStatsHelperTest, TestUnkownIfaceError) { +TEST_F(BpfNetworkStatsHelperTest, TestUnknownIfaceError) { updateIfaceMap(IFACE_NAME1, IFACE_INDEX1); StatsValue value1 = { .rxPackets = TEST_PACKET0,