Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/dram_and_fsdax/dram_and_fsdax.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(void) {
// - the UMF_TESTS_FSDAX_PATH environment variable to contain
// a path to a file on this FSDAX device.
char *path = getenv("UMF_TESTS_FSDAX_PATH");
if (path == NULL || path[0] == 0) {
if (path == NULL || path[0] == '\0') {
fprintf(
stderr,
"Warning: UMF_TESTS_FSDAX_PATH is not set, skipping testing ...\n");
Expand Down
4 changes: 2 additions & 2 deletions test/ipc_devdax_prov_consumer.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ int main(int argc, char *argv[]) {
int port = atoi(argv[1]);

char *path = getenv("UMF_TESTS_DEVDAX_PATH");
if (path == NULL || path[0] == 0) {
if (path == NULL || path[0] == '\0') {
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_PATH is not set\n");
return 0;
}

char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (size == NULL || size[0] == 0) {
if (size == NULL || size[0] == '\0') {
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_SIZE is not set\n");
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions test/ipc_devdax_prov_producer.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ int main(int argc, char *argv[]) {
int port = atoi(argv[1]);

char *path = getenv("UMF_TESTS_DEVDAX_PATH");
if (path == NULL || path[0] == 0) {
if (path == NULL || path[0] == '\0') {
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_PATH is not set\n");
return 0;
}

char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (size == NULL || size[0] == 0) {
if (size == NULL || size[0] == '\0') {
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_SIZE is not set\n");
return 0;
}
Expand Down
7 changes: 6 additions & 1 deletion test/pools/jemalloc_coarse_devdax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
bool devDaxEnvSet() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == 0 || size == nullptr || size[0] == 0) {
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return false;
}

Expand All @@ -20,6 +21,10 @@ bool devDaxEnvSet() {
void *createDevDaxParams() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return nullptr;
}

umf_devdax_memory_provider_params_handle_t params = NULL;
umf_result_t res =
Expand Down
7 changes: 6 additions & 1 deletion test/pools/scalable_coarse_devdax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
bool devDaxEnvSet() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == 0 || size == nullptr || size[0] == 0) {
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return false;
}

Expand All @@ -20,6 +21,10 @@ bool devDaxEnvSet() {
void *createDevDaxParams() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return nullptr;
}

umf_devdax_memory_provider_params_handle_t params = NULL;
umf_result_t res =
Expand Down
5 changes: 3 additions & 2 deletions test/provider_devdax_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ TEST_F(test, test_if_mapped_with_MAP_SYNC) {
umf_result_t umf_result;

char *path = getenv("UMF_TESTS_DEVDAX_PATH");
if (path == nullptr || path[0] == 0) {
if (path == nullptr || path[0] == '\0') {
GTEST_SKIP() << "Test skipped, UMF_TESTS_DEVDAX_PATH is not set";
}

Expand Down Expand Up @@ -169,7 +169,8 @@ using devdax_params_unique_handle_t =
devdax_params_unique_handle_t create_devdax_params() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == 0 || size == nullptr || size[0] == 0) {
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return devdax_params_unique_handle_t(
nullptr, &umfDevDaxMemoryProviderParamsDestroy);
}
Expand Down
6 changes: 4 additions & 2 deletions test/provider_devdax_memory_ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ using umf_test::test;
bool devDaxEnvSet() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == 0 || size == nullptr || size[0] == 0) {
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return false;
}

Expand All @@ -28,7 +29,8 @@ bool devDaxEnvSet() {
void *defaultDevDaxParamsCreate() {
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
if (path == nullptr || path[0] == 0 || size == nullptr || size[0] == 0) {
if (path == nullptr || path[0] == '\0' || size == nullptr ||
size[0] == '\0') {
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion test/provider_file_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TEST_F(test, test_if_mapped_with_MAP_SYNC) {
umf_result_t umf_result;

char *path = getenv("UMF_TESTS_FSDAX_PATH");
if (path == nullptr || path[0] == 0) {
if (path == nullptr || path[0] == '\0') {
GTEST_SKIP() << "Test skipped, UMF_TESTS_FSDAX_PATH is not set";
}

Expand Down
2 changes: 1 addition & 1 deletion test/provider_file_memory_ipc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static std::vector<ipcTestParams> getIpcFsDaxTestParamsList(void) {
std::vector<ipcTestParams> ipcFsDaxTestParamsList = {};

char *path = getenv("UMF_TESTS_FSDAX_PATH");
if (path == nullptr || path[0] == 0) {
if (path == nullptr || path[0] == '\0') {
// skipping the test, UMF_TESTS_FSDAX_PATH is not set
return ipcFsDaxTestParamsList;
}
Expand Down