newlib: one more test (fread)
This commit is contained in:
		
							
								
								
									
										0
									
								
								qa/lib/newlib/100-files.runner
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								qa/lib/newlib/100-files.runner
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										28
									
								
								qa/lib/newlib/101-files.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								qa/lib/newlib/101-files.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | |||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include <string.h> | ||||||
|  | int main() | ||||||
|  | { | ||||||
|  | 	char buf[64]; | ||||||
|  | 	FILE *fptr; | ||||||
|  |  | ||||||
|  | 	fptr = fopen("/tmp/qa-fprint.txt", "w"); | ||||||
|  | 	if(fptr == NULL) | ||||||
|  | 		exit(1); | ||||||
|  |  | ||||||
|  | 	fprintf(fptr, "%s", "DONE"); | ||||||
|  | 	fclose(fptr); | ||||||
|  |  | ||||||
|  | 	fptr = fopen("/tmp/qa-fprint.txt", "r"); | ||||||
|  | 	if(fptr == NULL) | ||||||
|  | 		exit(2); | ||||||
|  | 	fread (buf, 1, 64, fptr); | ||||||
|  | 	fclose(fptr); | ||||||
|  |  | ||||||
|  | 	if(strncmp(buf, "DONE", 4) != 0){ | ||||||
|  | 		printf("'%s'", buf); | ||||||
|  | 		exit(4); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
| @@ -32,7 +32,8 @@ | |||||||
| 		"SourceFilesCmd": [ | 		"SourceFilesCmd": [ | ||||||
| 			"000-hello.c", | 			"000-hello.c", | ||||||
| 			"010-fork.c", | 			"010-fork.c", | ||||||
| 			"100-files.c" | 			"100-files.c", | ||||||
|  | 			"101-files.c" | ||||||
| 		] | 		] | ||||||
| 	}, | 	}, | ||||||
| 	"NewlibTestsuite": { | 	"NewlibTestsuite": { | ||||||
|   | |||||||
							
								
								
									
										0
									
								
								qa/lib/newlib/testsuite/atexit.runner
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								qa/lib/newlib/testsuite/atexit.runner
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Reference in New Issue
	
	Block a user