diff --git a/src/lib/support/tests/TestScopedBuffer.cpp b/src/lib/support/tests/TestScopedBuffer.cpp index 71e3a6044e6621..ac61810553960a 100644 --- a/src/lib/support/tests/TestScopedBuffer.cpp +++ b/src/lib/support/tests/TestScopedBuffer.cpp @@ -137,9 +137,29 @@ static const nlTest sTests[] = { NL_TEST_SENTINEL() // }; +/** + * Set up the test suite. + */ +int TestScopedBuffer_Setup(void * inContext) +{ + CHIP_ERROR error = chip::Platform::MemoryInit(); + if (error != CHIP_NO_ERROR) + return FAILURE; + return SUCCESS; +} + +/** + * Tear down the test suite. + */ +int TestScopedBuffer_Teardown(void * inContext) +{ + chip::Platform::MemoryShutdown(); + return SUCCESS; +} + int TestScopedBuffer(void) { - nlTestSuite theSuite = { "CHIP ScopedBuffer tests", &sTests[0], nullptr, nullptr }; + nlTestSuite theSuite = { "CHIP ScopedBuffer tests", &sTests[0], TestScopedBuffer_Setup, TestScopedBuffer_Teardown }; // Run test suit againt one context. nlTestRunner(&theSuite, nullptr);