Merge "Correct typos in libnetworkstats" am: 1b5f93df43

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1957868

Change-Id: Ife12509c7859840df388d5492f66a9c884801e4d
This commit is contained in:
Maciej Żenczykowski 2022-01-26 00:05:35 +00:00 • committed by Automerger Merge Worker
commit 8cb78a196f
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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,