Home | History | Annotate | Download | only in sched_get_priority_max
      1 /*
      2  *  This program is free software; you can redistribute it and/or modify
      3  *  it under the terms of the GNU General Public License version 2.
      4  *
      5  *  This program is distributed in the hope that it will be useful,
      6  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      7  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      8  *  GNU General Public License for more details.
      9  *
     10  *
     11  * Test that sched_get_priority_max() returns -1 on failure.
     12  */
     13 #include <stdio.h>
     14 #include <sched.h>
     15 #include <errno.h>
     16 #include "posixtest.h"
     17 
     18 int main(void)
     19 {
     20 	int result = -1;
     21 
     22 	result = sched_get_priority_max(-1);
     23 
     24 	if (result == -1 && errno == EINVAL) {
     25 		printf("Test PASSED\n");
     26 		return PTS_PASS;
     27 	}
     28 
     29 	if (result != -1) {
     30 		printf("did no returned -1.\n");
     31 		return PTS_FAIL;
     32 	}
     33 
     34 	if (errno != EINVAL) {
     35 		perror("error is not EINVAL");
     36 		return PTS_FAIL;
     37 	}
     38 
     39 	printf("Unresolved test error\n");
     40 	return PTS_UNRESOLVED;
     41 }
     42