From e7dc0d2bd9d457a641522867b34125c52f4f9b05 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:10:43 +0800 Subject: [PATCH] [202405] Fix compilation error on Buster (#1483) 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. --- unittest/syncd/TestSyncd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unittest/syncd/TestSyncd.cpp b/unittest/syncd/TestSyncd.cpp index baa6d014f..cfc7124df 100644 --- a/unittest/syncd/TestSyncd.cpp +++ b/unittest/syncd/TestSyncd.cpp @@ -11,6 +11,7 @@ using namespace syncd; +#ifdef MOCK_METHOD class MockSelectableChannel : public sairedis::SelectableChannel { public: MOCK_METHOD(bool, empty, (), (override)); @@ -59,3 +60,5 @@ TEST_F(SyncdTest, processNotifySyncd) })); syncd_object.processEvent(consumer); } + +#endif