| 1847 | } |
| 1848 | |
| 1849 | static bool sp_stdout_fixture_open(sp_stdout_fixture_t *fx) { |
| 1850 | memset(fx, 0, sizeof(*fx)); |
| 1851 | if (!sp_stdout_test_binary || !sp_stdout_test_binary[0]) |
| 1852 | return false; |
| 1853 | const char *root = th_mktempdir("cbm-sp-stdout"); |
| 1854 | if (!root) |
| 1855 | return false; |
| 1856 | int n = snprintf(fx->root, sizeof(fx->root), "%s", root); |
| 1857 | bool ok = n > 0 && (size_t)n < sizeof(fx->root) && sp_stdout_path(fx->out, root, "out.bin") && |
| 1858 | sp_stdout_path(fx->log, root, "err.log") && |
| 1859 | sp_stdout_path(fx->other, root, "other.bin") && |
| 1860 | sp_stdout_path(fx->gate, root, "release"); |
| 1861 | if (!ok) |
| 1862 | (void)th_rmtree(root); |
| 1863 | return ok; |
| 1864 | } |
| 1865 | |
| 1866 | static bool sp_stdout_file_equals(const char *path, const void *bytes, size_t count) { |
| 1867 | FILE *file = cbm_fopen(path, "rb"); |
no test coverage detected