Skip to content

Commit f574a2b

Browse files
committed
Fix generic_max_flow_test.cc
- Add missing `operator!=` for `StrongUint16` - Fix test logic for Solve in `SmallFlowTypes`
1 parent 0cf2d19 commit f574a2b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ortools/graph/generic_max_flow_test.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ constexpr bool operator>=(StrongUint16 a, StrongUint16 b) { return a.v >= b.v; }
294294
constexpr bool operator>(StrongUint16 a, StrongUint16 b) { return a.v > b.v; }
295295
constexpr bool operator<(StrongUint16 a, StrongUint16 b) { return a.v < b.v; }
296296
constexpr bool operator==(StrongUint16 a, StrongUint16 b) { return a.v == b.v; }
297+
constexpr bool operator!=(StrongUint16 a, StrongUint16 b) { return a.v != b.v; }
297298

298299
// This is a bit hacky, but we need to define the overload in the std namespace.
299300
} // namespace
@@ -333,8 +334,10 @@ TYPED_TEST(GenericMaxFlowTest, SmallFlowTypes) {
333334
max_flow_A.SetArcCapacity(arc, capa);
334335
max_flow_B.SetArcCapacity(arc, capa);
335336
}
336-
EXPECT_EQ(max_flow_A.Solve(), MaxFlowA::OPTIMAL);
337-
EXPECT_EQ(max_flow_B.Solve(), MaxFlowB::OPTIMAL);
337+
EXPECT_TRUE(max_flow_A.Solve());
338+
EXPECT_EQ(max_flow_A.status(), MaxFlowA::OPTIMAL);
339+
EXPECT_TRUE(max_flow_B.Solve());
340+
EXPECT_EQ(max_flow_B.status(), MaxFlowB::OPTIMAL);
338341
EXPECT_EQ(max_flow_A.GetOptimalFlow(), max_flow_B.GetOptimalFlow());
339342
}
340343

0 commit comments

Comments
 (0)