Showing the changes to test (2 of 2 files). Show all
Unified · Split
| @@ -20,9 +20,15 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <stdarg.h> |
| 21 | 21 | #include <stdio.h> |
| 22 | 22 | #include <stdlib.h> |
| 23 | −#include <unistd.h> | |
| 24 | 23 | #include <string.h> |
| 25 | 24 | |
| 25 | +#ifdef _WIN32 | |
| 26 | +#include <sys/types.h> | |
| 27 | +#include <io.h> | |
| 28 | +#else | |
| 29 | +#include <unistd.h> | |
| 30 | +#endif | |
| 31 | + | |
| 26 | 32 | // Stolen from osdep/compiler.h |
| 27 | 33 | #ifdef __GNUC__ |
| 28 | 34 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) |
| @@ -97,6 +103,8 @@ static void check_output(int fd) · 68 unmodified lines | ||
| 97 | 103 | puts("output file ok"); |
| 98 | 104 | } |
| 99 | 105 | |
| 106 | +int mp_mkostemps(char *template, int suffixlen, int flags); | |
| 107 | + | |
| 100 | 108 | int main(int argc, char *argv[]) |
| 101 | 109 | { |
| 102 | 110 | atexit(exit_cleanup); |
| @@ -108,7 +116,7 @@ int main(int argc, char *argv[]) · 5 unmodified lines | ||
| 108 | 116 | int fd; |
| 109 | 117 | { |
| 110 | 118 | char path[] = "./testout.XXXXXX"; |
| 111 | − fd = mkstemp(path); | |
| 119 | + fd = mp_mkostemps(path, 0, 0); | |
| 112 | 120 | if (fd == -1) |
| 113 | 121 | fail("mkstemp failed"); |
| 114 | 122 | out_path = strdup(path); |
| @@ -15,6 +15,7 @@ test_utils_files = [ · 14 unmodified lines | ||
| 15 | 15 | 'common/common.c', |
| 16 | 16 | 'misc/bstr.c', |
| 17 | 17 | 'misc/dispatch.c', |
| 18 | + 'misc/io_utils.c', | |
| 18 | 19 | 'misc/json.c', |
| 19 | 20 | 'misc/node.c', |
| 20 | 21 | 'misc/path_utils.c', |
| @@ -124,7 +125,7 @@ if get_option('libmpv') · 103 unmodified lines | ||
| 124 | 125 | test('libmpv', exe, args: file, timeout: 60) |
| 125 | 126 | |
| 126 | 127 | exe = executable('libmpv-encode', 'libmpv_encode.c', |
| 127 | − include_directories: incdir, link_with: libmpv) | |
| 128 | + include_directories: incdir, link_with: [libmpv, test_utils]) | |
| 128 | 129 | test('libmpv-encode', exe, timeout: 30) |
| 129 | 130 | endif |
| 130 | 131 | |