Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fboss: fix ambiguous overloaded operator #116

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fboss/agent/hw/sai/store/tests/AclTableGroupStoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TEST_P(AclTableGroupStoreParamTest, loadAclTableGroupMember) {
auto got = store.get(k);
EXPECT_NE(got, nullptr);
EXPECT_EQ(got->adapterKey(), aclTableGroupMemberId);
EXPECT_EQ(got->adapterKey(), aclTableId);
EXPECT_EQ(got->adapterKey(), uint64_t(aclTableId));
}

TEST_P(AclTableGroupStoreParamTest, aclTableGroupLoadCtor) {
Expand Down
2 changes: 1 addition & 1 deletion fboss/agent/hw/sai/switch/tests/PortManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PortManagerTest : public ManagerTestBase {
EXPECT_EQ(enabled, gotAdminState);
auto gotLanes = portApi.getAttribute(saiId, hwLaneListAttribute);
EXPECT_EQ(1, gotLanes.size());
EXPECT_EQ(swId, gotLanes[0]);
EXPECT_EQ(swId, uint16_t(gotLanes[0]));
auto gotSpeed = portApi.getAttribute(saiId, speedAttribute);
EXPECT_EQ(25000, gotSpeed);
auto gotFecMode = portApi.getAttribute(saiId, fecMode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TEST_F(VirtualRouterManagerTest, defaultVirtualRouterTest) {
saiManagerTable->virtualRouterManager().getVirtualRouterHandle(
RouterID(0));
EXPECT_TRUE(virtualRouterHandle);
EXPECT_EQ(virtualRouterHandle->virtualRouter->adapterKey(), 0);
EXPECT_EQ(virtualRouterHandle->virtualRouter->adapterKey(), uint64_t(0));

EXPECT_TRUE(virtualRouterHandle->mplsRouterInterface);

Expand Down
2 changes: 1 addition & 1 deletion fboss/agent/state/tests/RouteTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ TEST(Route, serializeMplsRoute) {
// back to Route object
auto rt2 = Route<LabelID>::fromFollyDynamic(obj2);
ASSERT_TRUE(rt2->has(clientId, RouteNextHopEntry(nxtHops, DISTANCE)));
EXPECT_EQ(rt2->getID().label, 100);
EXPECT_EQ(int32_t(rt2->getID().label), 100);
}

// Serialization/deseralization of Routes with counterID
Expand Down
6 changes: 4 additions & 2 deletions fboss/agent/state/tests/SwitchSettingsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ TEST(SwitchSettingsTest, applyBlockNeighbors) {
EXPECT_EQ(switchSettingsV1->getBlockNeighbors().size(), 1);

EXPECT_EQ(
switchSettingsV1->getBlockNeighbors()[0].first, blockNeighbor.vlanID());
int(switchSettingsV1->getBlockNeighbors()[0].first),
blockNeighbor.vlanID());
EXPECT_EQ(
switchSettingsV1->getBlockNeighbors()[0].second.str(),
blockNeighbor.ipAddress());
Expand Down Expand Up @@ -201,7 +202,8 @@ TEST(SwitchSettingsTest, applyMacAddrsToBlock) {
EXPECT_EQ(switchSettingsV1->getMacAddrsToBlock().size(), 1);

EXPECT_EQ(
switchSettingsV1->getMacAddrsToBlock()[0].first, macAddrToBlock.vlanID());
int(switchSettingsV1->getMacAddrsToBlock()[0].first),
macAddrToBlock.vlanID());
EXPECT_EQ(
switchSettingsV1->getMacAddrsToBlock()[0].second.toString(),
macAddrToBlock.macAddress());
Expand Down
7 changes: 4 additions & 3 deletions fboss/qsfp_service/platforms/wedge/tests/WedgeManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ TEST_F(WedgeManagerTest, moduleNotPresentTest) {
// id is 0 based here
EXPECT_EQ(
transceiverManager_->getCurrentState(TransceiverID(trans.first)),
trans.first == 0 ? TransceiverStateMachineState::NOT_PRESENT
: TransceiverStateMachineState::DISCOVERED);
trans.first == uint16_t(0)
? TransceiverStateMachineState::NOT_PRESENT
: TransceiverStateMachineState::DISCOVERED);
}
}
}
Expand All @@ -210,7 +211,7 @@ TEST_F(WedgeManagerTest, mgmtInterfaceChangedTest) {
auto currentModules = transceiverManager_->mgmtInterfaces();
EXPECT_EQ(currentModules.size(), 16);
for (auto module : currentModules) {
if (module.first == 0) {
if (module.first == uint16_t(0)) {
EXPECT_EQ(module.second, TransceiverManagementInterface::CMIS);
} else {
EXPECT_EQ(module.second, TransceiverManagementInterface::SFF);
Expand Down
3 changes: 2 additions & 1 deletion fboss/qsfp_service/test/hw_test/HwPortPrbsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ class HwPortPrbsTest : public HwExternalPhyPortTest {
EXPECT_EQ(laneStats.size(), lanes.size());
int laneStatsIdx = 0;
for (const auto& laneIt : lanes) {
EXPECT_EQ(laneIt.first, *laneStats[laneStatsIdx++].laneId());
EXPECT_EQ(
laneIt.first, uint32_t(*laneStats[laneStatsIdx++].laneId()));
}
} else {
EXPECT_TRUE(laneStats.empty());
Expand Down