From e82b22194eaedaab98019f8954ca49cb8237b4c5 Mon Sep 17 00:00:00 2001 From: Yuanzheng Song Date: Wed, 30 Mar 2022 16:08:22 +0800 Subject: [PATCH] fix codecheck warnings issue: #I50E2W Signed-off-by: Yuanzheng Song --- .../libdmabufheap/dmabuf_alloc_test.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp b/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp index 72dcd2e..e6daa2e 100644 --- a/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp +++ b/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp @@ -13,24 +13,25 @@ * limitations under the License. */ -#include "gtest/gtest.h" -#include -#include +#include +#include #include -#include +#include #include #include #include #include #include -#include +#include +#include "gtest/gtest.h" #include "dmabuf_alloc.h" -#define BUFFER_SIZE 128 - using namespace testing; using namespace testing::ext; +namespace { +const int BUFFER_SIZE = 128; + class DmabufAllocTest : public testing::Test { public: static void SetUpTestCase(); @@ -120,7 +121,7 @@ HWTEST_F(DmabufAllocTest, ShareBufferBetweenProcess, Function|MediumTest|Level1) exit(EXIT_SUCCESS); } /* parent process */ - waitpid(pid, NULL, 0); + waitpid(pid, nullptr, 0); ASSERT_EQ(0, DmabufHeapBufferSyncStart(buffer.fd, DMA_BUF_HEAP_BUF_SYNC_RW)); @@ -258,4 +259,5 @@ HWTEST_F(DmabufAllocTest, ExchangeBufferSyncOrder, Function|MediumTest|Level1) ASSERT_EQ(0, DmabufHeapBufferFree(&buffer)); ASSERT_EQ(0, DmabufHeapClose(heapFd)); +} } \ No newline at end of file -- Gitee