TDD测试用例

Signed-off-by: wanghaixiang <wanghaixiang@huawei.com>
This commit is contained in:
wanghaixiang 2021-09-13 11:59:22 +08:00
parent 06d716c25e
commit fd1680655d
2 changed files with 8 additions and 7 deletions

View File

@ -211,9 +211,9 @@ if (ohos_kernel_type == "liteos_m") {
"//third_party/bounds_checking_function:libsec_shared",
]
}
#if (ohos_build_type == "debug") {
# group("huks_new_test") {
# deps = [ "//base/security/huks/test:huks_new_test" ]
# }
#}
if (ohos_build_type == "debug") {
group("huks_new_test") {
deps = [ "//base/security/huks/test:huks_new_test" ]
}
}
}

View File

@ -145,12 +145,13 @@ static int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *b
}
int32_t size = write(fd, buf, len);
close(fd);
if (size < 0) {
HKS_LOG_E("write file size failed, errno = 0x%x", errno);
close(fd);
return HKS_ERROR_WRITE_FILE_FAIL;
}
fsync(fd);
close(fd);
return HKS_SUCCESS;
}