Home | History | Annotate | Download | only in newlib_tests
      1 /*
      2  * Copyright (c) 2016 Cyril Hrubis <chrubis (at) suse.cz>
      3  *
      4  * This program is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU General Public License as
      6  * published by the Free Software Foundation; either version 2 of
      7  * the License, or (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it would be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program; if not, write the Free Software Foundation,
     16  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     17  */
     18 
     19 /*
     20  * The tst_resm() and tst_brkm() should be rerouted to the new lib.
     21  */
     22 
     23 #include "tst_test.h"
     24 
     25 void tst_resm_(char *, int, int, char *);
     26 void tst_brkm_(char *, int, int, void (*)(void), char *);
     27 
     28 static void cleanup(void)
     29 {
     30 }
     31 
     32 static void do_test(unsigned int i)
     33 {
     34 	switch (i) {
     35 	case 0:
     36 		tst_resm_(__FILE__, __LINE__, TINFO, "info message");
     37 		tst_resm_(__FILE__, __LINE__, TPASS, "passed message");
     38 	break;
     39 	case 1:
     40 		tst_brkm_(__FILE__, __LINE__, TCONF, cleanup, "Non-NULL cleanup");
     41 	break;
     42 	}
     43 }
     44 
     45 static struct tst_test test = {
     46 	.tid = "test02",
     47 	.tcnt = 2,
     48 	.test = do_test,
     49 };
     50