Unit test under Win32

This commit is contained in:
cpq committed 2026-06-25 10:22:13 +01:00
1 parent c288ac1f38
commit 8c0b6e335e
3 files changed
+8 -3

No files matched your search

+1
View File
@@ -778,6 +778,7 @@ typedef int socklen_t;
#define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX)
#define sleep(x) Sleep((x) *1000)
#define mkdir(a, b) _mkdir(a)
#define rmdir(a) _rmdir(a)
#define timegm(x) _mkgmtime(x)
#ifndef S_ISDIR
+1
View File
@@ -159,6 +159,7 @@ typedef int socklen_t;
#define realpath(a, b) _fullpath((b), (a), MG_PATH_MAX)
#define sleep(x) Sleep((x) *1000)
#define mkdir(a, b) _mkdir(a)
#define rmdir(a) _rmdir(a)
#define timegm(x) _mkgmtime(x)
#ifndef S_ISDIR
+6 -3
View File
@@ -4422,9 +4422,9 @@ static bool set3_fn(enum mg_dash_op op, struct mg_dash_user *u) {
static bool test_upload_dir(const struct mg_dash_user *u, char *buf, size_t len) {
(void) u;
#if MG_ARCH == MG_ARCH_UNIX || MG_ARCH == MG_ARCH_WIN32
mkdir("/tmp/mongoose_dash_test", 0755);
mkdir("mongoose_dash_test", 0755);
#endif
mg_snprintf(buf, len, "%s", "/tmp/mongoose_dash_test");
mg_snprintf(buf, len, "%s", "mongoose_dash_test");
return true;
}
@@ -4588,7 +4588,7 @@ static void test_dash(void) {
memset(&dash, 0, sizeof(dash));
dash.session_auto_expiration_seconds = 1;
remove("/tmp/mongoose_dash_test/test.bin");
remove("mongoose_dash_test/test.bin");
MG_DASH_ADD_FIELD_SET(&dash, &test_files_set);
MG_DASH_ADD_FIELD_SET(&dash, &set1);
@@ -4917,6 +4917,9 @@ static void test_dash(void) {
ASSERT(strstr(buf, test_bin_probe) != NULL);
mg_mgr_free(&mgr3);
}
remove("mongoose_dash_test/test.bin");
rmdir("mongoose_dash_test");
}
#define DASHBOARD(x) \