Module Name:    src
Committed By:   jruoho
Date:           Sun Jun  5 13:51:46 UTC 2011

Modified Files:
        src/tests/lib/libc/stdlib: t_strtol.c

Log Message:
Do not blindly cast things (obviously makes the test fail).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/stdlib/t_strtol.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtol.c
diff -u src/tests/lib/libc/stdlib/t_strtol.c:1.2 src/tests/lib/libc/stdlib/t_strtol.c:1.3
--- src/tests/lib/libc/stdlib/t_strtol.c:1.2	Sat Jun  4 22:49:49 2011
+++ src/tests/lib/libc/stdlib/t_strtol.c	Sun Jun  5 13:51:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtol.c,v 1.2 2011/06/04 22:49:49 haad Exp $ */
+/*	$NetBSD: t_strtol.c,v 1.3 2011/06/05 13:51:46 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_strtol.c,v 1.2 2011/06/04 22:49:49 haad Exp $");
+__RCSID("$NetBSD: t_strtol.c,v 1.3 2011/06/05 13:51:46 jruoho Exp $");
 
 #include <atf-c.h>
 #include <errno.h>
@@ -40,7 +40,7 @@
 
 struct test {
 	const char	*str;
-	long int	 res;
+	long long int	 res;
 	int		 base;
 	const char	*end;
 };
@@ -55,7 +55,7 @@
 		atf_tc_fail_nonfatal("strtol(%s, &end, %d) failed "
 		    "(rv = %ld)", t->str, t->base, li);
 
-	if (lli != -1 && lli != (long long int)t->res)
+	if (lli != -1 && lli != t->res)
 		atf_tc_fail_nonfatal("strtoll(%s, NULL, %d) failed "
 		    "(rv = %lld)", t->str, t->base, lli);
 
@@ -92,8 +92,8 @@
 		{ "123456789",			    342391,  8, NULL	},
 		{ "0123456789",			    342391,  0, NULL	},
 		{ "0123456789",			 123456789, 10, NULL	},
-		{ "0123456789",		       (uint32_t)0x123456789, 16, NULL	},
-		{ "0x123456789",	       (uint32_t)0x123456789,  0, NULL	},
+		{ "0123456789",		       0x123456789, 16, NULL	},
+		{ "0x123456789",	       0x123456789,  0, NULL	},
 		{ "0x75bcd15",		         123456789,  0, NULL	},
 	};
 

Reply via email to