xref: /freebsd/contrib/libarchive/cat/test/test_stdin.c (revision bd66c1b43e33540205dbc1187c2f2a15c58b57ba)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2017 Sean Purcell
5  * All rights reserved.
6  */
7 #include "test.h"
8 
9 #if !defined(_WIN32) || defined(__CYGWIN__)
10 #define DEV_NULL "/dev/null"
11 #else
12 #define DEV_NULL "NUL"
13 #endif
14 
DEFINE_TEST(test_stdin)15 DEFINE_TEST(test_stdin)
16 {
17 	int f;
18 
19 	f = systemf("%s <%s >test.out 2>test.err", testprog, DEV_NULL);
20 	assertEqualInt(0, f);
21 	assertEmptyFile("test.out");
22 	assertEmptyFile("test.err");
23 }
24 
25