bug 556190 - op_filok NSPR test fails on Android. Patch by Alex Pakhotin <alexp@mozilla.com>, r=ted NSPR_HEAD_20100924
authorted.mielczarek%gmail.com
Fri, 24 Sep 2010 18:21:22 +0000
changeset 4277 70bd678ab93026a41ba276c11bc90a6773be0da7
parent 4276 4387d02de4a5470e61b6a1000a116a7e9c8ab14c
child 4278 922b6c2fff9f84e07023bfafff51502b6fa9b02c
push idunknown
push userunknown
push dateunknown
reviewersted
bugs556190
bug 556190 - op_filok NSPR test fails on Android. Patch by Alex Pakhotin <alexp@mozilla.com>, r=ted
pr/tests/op_filok.c
--- a/pr/tests/op_filok.c
+++ b/pr/tests/op_filok.c
@@ -50,48 +50,27 @@
 ***********************************************************************/
 /* Used to get the command line option */
 #include "prinit.h"
 #include "prmem.h"
 #include "prio.h"
 #include "prerror.h"
 #include <stdio.h>
 
-/*
- * The name of a file that is guaranteed to exist
- * on every machine of a particular OS.
- */
-#if defined(SYMBIAN)
-#define EXISTING_FILENAME "z:\\system\\install\\Series60v3.0.sis"
-#elif defined (XP_UNIX)
-#define EXISTING_FILENAME "/bin/sh"
-#elif defined(WINCE)
-#define EXISTING_FILENAME "/Windows/services.exe"
-#elif defined(WIN32)
-#define EXISTING_FILENAME "c:/autoexec.bat"
-#elif defined(OS2)
-#define EXISTING_FILENAME "c:/config.sys"
-#elif defined(BEOS)
-#define EXISTING_FILENAME "/boot/beos/bin/sh"
-#else
-#error "Unknown OS"
-#endif
-
 static PRFileDesc *t1;
 
 int main(int argc, char **argv)
 {
     PR_STDIO_INIT();
 
-	t1 = PR_Open(EXISTING_FILENAME, PR_RDONLY, 0666);
+ 	t1 = PR_Open(argv[0], PR_RDONLY, 0666);
 
 	if (t1 == NULL) {
 		printf ("error code is %d \n", PR_GetError());
-		printf ("File %s should be found\n",
-				EXISTING_FILENAME);
+ 		printf ("File %s should be found\n", argv[0]);
 		return 1;
 	} else {
 		if (PR_Close(t1) == PR_SUCCESS) {
 			printf ("Test passed \n");
 			return 0;
 		} else {
 			printf ("cannot close file\n");
 			printf ("error code is %d\n", PR_GetError());