Project

General

Profile

Bug #3154 » test2.c

better test case - Bernardo Signori, 2012-09-05 02:32 PM

 
1
#include <stdio.h>
2
#include <string.h>
3
#include <locale.h>
4
#include <ctype.h>
5

    
6
int main() {
7
  char* l = setlocale(LC_CTYPE, "en_US.UTF-8");
8
  if(l == NULL) {
9
	printf("Can't change locale, test skipped\n");
10
	return 0;
11
  }
12
  printf("Changed locale to %s\n", l);
13
  unsigned char a = 0x80;
14
  printf("tolower test ");
15
  if(tolower(a) == 0) {
16
    printf("FAIL\n");
17
  }
18
  else {
19
    printf("PASS\n");
20
  }
21
  printf("toupper test ");
22
  if(toupper(a) == 0) {
23
    printf("FAIL\n");
24
  }
25
  else {
26
    printf("PASS\n");
27
  }
28

    
29
  return 0;
30
}
(2-2/2)