Skip to content

Commit

Permalink
[202405] Fix compilation error on Buster (#1483)
Browse files Browse the repository at this point in the history
There is issue causing compilation failures of sairedis on Buster. Since the SONiC PTF container is still based on Buster, sairedis still needs to compile for Buster.

The TestSyncd.cpp file uses the MOCK_METHOD macro. However, this macro is available only from version 1.10 of gmock, but Buster has version 1.8.1. As a simple fix, check to see if MOCK_METHOD is defined; if not, then don't compile this test.
  • Loading branch information
Junchao-Mellanox authored Dec 10, 2024
1 parent 06d3461 commit e7dc0d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unittest/syncd/TestSyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

using namespace syncd;

#ifdef MOCK_METHOD
class MockSelectableChannel : public sairedis::SelectableChannel {
public:
MOCK_METHOD(bool, empty, (), (override));
Expand Down Expand Up @@ -59,3 +60,5 @@ TEST_F(SyncdTest, processNotifySyncd)
}));
syncd_object.processEvent(consumer);
}

#endif

0 comments on commit e7dc0d2

Please sign in to comment.