diff --git a/kernel_lite/fs_posix/src/FsStdlibTest.cpp b/kernel_lite/fs_posix/src/FsStdlibTest.cpp index 78846d816cb3499aff58c03dc0f61b1a3241bbb8..a1aa52834f55342930ce2666b97e7579a396aac0 100755 --- a/kernel_lite/fs_posix/src/FsStdlibTest.cpp +++ b/kernel_lite/fs_posix/src/FsStdlibTest.cpp @@ -120,8 +120,16 @@ HWTEST_F(FileSystemTest, testRealpath, Function | MediumTest | Level3) // get Absolute Path const char *realPathStandard = TOP_DIR "/" FILE0; char *realPath = (char*)malloc(256); - ASSERT_NE(realpath(FILE0, realPath), nullptr) << "> realpath errno = " << errno; - EXPECT_STREQ(realPath, realPathStandard); - LOG("> realPath = %s", realPath); - free(realPath); + if (realpath(FILE0, realPath) == nullptr) + { + LOG("> realpath errno == %d", errno); + free(realPath); + ASSERT_TRUE(false); + } + else + { + EXPECT_STREQ(realPath, realPathStandard); + LOG("> realPath = %s", realPath); + free(realPath); + } }