1328324Smm/*-
2328324Smm * Copyright (c) 2017 Sean Purcell
3328324Smm * All rights reserved.
4328324Smm *
5328324Smm * Redistribution and use in source and binary forms, with or without
6328324Smm * modification, are permitted provided that the following conditions
7328324Smm * are met:
8328324Smm * 1. Redistributions of source code must retain the above copyright
9328324Smm *    notice, this list of conditions and the following disclaimer.
10328324Smm * 2. Redistributions in binary form must reproduce the above copyright
11328324Smm *    notice, this list of conditions and the following disclaimer in the
12328324Smm *    documentation and/or other materials provided with the distribution.
13328324Smm *
14328324Smm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15328324Smm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16328324Smm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17328324Smm * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18328324Smm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19328324Smm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20328324Smm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21328324Smm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22328324Smm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23328324Smm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24328324Smm */
25328324Smm#include "test.h"
26328324Smm
27328324Smm#if !defined(_WIN32) || defined(__CYGWIN__)
28328324Smm#define DEV_NULL "/dev/null"
29328324Smm#else
30328324Smm#define DEV_NULL "NUL"
31328324Smm#endif
32328324Smm
33328324SmmDEFINE_TEST(test_stdin)
34328324Smm{
35328324Smm	int f;
36328324Smm
37328324Smm	f = systemf("%s <%s >test.out 2>test.err", testprog, DEV_NULL);
38328324Smm	assertEqualInt(0, f);
39328324Smm	assertEmptyFile("test.out");
40328324Smm	assertEmptyFile("test.err");
41328324Smm}
42328324Smm
43