data file tests: fix [32af28] generate data directory test

This commit is contained in:
gitlost 2021-06-16 17:56:32 +01:00
parent f6a90c5a48
commit 21a4e2c1f6
6 changed files with 30 additions and 18 deletions

View File

@ -142,9 +142,11 @@ static void test_print(int index, int generate, int debug) {
int escaped_size = 1024; int escaped_size = 1024;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }

View File

@ -80,9 +80,11 @@ static void test_print(int index, int generate, int debug) {
int escaped_size = 1024; int escaped_size = 1024;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }

View File

@ -196,9 +196,11 @@ static void test_print(int index, int generate, int debug) {
char *text; char *text;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }

View File

@ -71,9 +71,11 @@ static void test_print(int index, int generate, int debug) {
int escaped_size = 1024; int escaped_size = 1024;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }

View File

@ -111,9 +111,11 @@ static void test_print(int index, int generate, int debug) {
char *text; char *text;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }

View File

@ -190,9 +190,11 @@ static void test_print(int index, int generate, int debug) {
char *text; char *text;
if (generate) { if (generate) {
if (!testUtilExists(data_dir)) { char data_dir_path[1024];
ret = testutil_mkdir(data_dir, 0755); assert_nonzero(testUtilDataPath(data_dir_path, sizeof(data_dir_path), data_dir, NULL), "testUtilDataPath(%s) == 0\n", data_dir);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir, ret, errno, strerror(errno)); if (!testUtilExists(data_dir_path)) {
ret = testutil_mkdir(data_dir_path, 0755);
assert_zero(ret, "testutil_mkdir(%s) ret %d != 0 (%d: %s)\n", data_dir_path, ret, errno, strerror(errno));
} }
} }