• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  // SPDX-License-Identifier: GPL-2.0-or-later
2  /*
3   * Copyright (c) 2016 Cyril Hrubis <chrubis@suse.cz>
4   */
5  
6  #include "tst_test.h"
7  #include "tst_safe_stdio.h"
8  #include "tst_safe_net.h"
9  
cleanup(void)10  static void cleanup(void)
11  {
12  	int i;
13  
14  	tst_brk(TBROK, "TBROK in cleanup");
15  	SAFE_OPEN("foo", O_RDWR);
16  	SAFE_FILE_SCANF("foo", "%i", &i);
17  	SAFE_TOUCH("doo/foo", 0777, NULL);
18  	SAFE_FOPEN("foo", "r");
19  	SAFE_SOCKET(AF_UNIX, SOCK_STREAM, -1);
20  	tst_res(TINFO, "Test still here");
21  }
22  
do_test(void)23  static void do_test(void)
24  {
25  	tst_res(TPASS, "Passed");
26  }
27  
28  static struct tst_test test = {
29  	.test_all = do_test,
30  	.cleanup = cleanup,
31  };
32