Your message dated Mon, 25 Dec 2006 23:02:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#404118: fixed in check 0.9.4-3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: check
Version: 0.9.4-2
Severity: grave
Tags: patch
Justification: renders package unusable

check uses "i" in the loop test macro, which breaks every use that uses
"i" locally. since "i" is the most ommon loop variable in C, it will
break in almost any case.

cu  robert

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (670, 'unstable'), (600, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.6
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information

-- 
Robert Lemmen                               http://www.semistable.com 
Index: src/check.h.in
===================================================================
--- src/check.h.in      (revision 368)
+++ src/check.h.in      (revision 369)
@@ -174,7 +174,7 @@
    One must use braces within a START_/END_ pair to declare new variables
 */ 
 #define START_TEST(__testname)\
-static void __testname (int i __attribute__((unused)))\
+static void __testname (int _i __attribute__((unused)))\
 {\
   tcase_fn_start (""# __testname, __FILE__, __LINE__);
 
Index: tests/ex_xml_output.c
===================================================================
--- tests/ex_xml_output.c       (revision 368)
+++ tests/ex_xml_output.c       (revision 369)
@@ -29,7 +29,7 @@
 
 START_TEST(test_loop)
 {
-  fail_unless (i==1, "Iteration %d failed", i);
+  fail_unless (_i==1, "Iteration %d failed", _i);
 }
 END_TEST
 
Index: tests/check_check_master.c
===================================================================
--- tests/check_check_master.c  (revision 368)
+++ tests/check_check_master.c  (revision 369)
@@ -204,14 +204,14 @@
 START_TEST(test_check_tcnames)
 {
   const char *tcname;   
-  tcname = tr_tcname(tr_all_array[i]);
-  if (strcmp(tcname, master_tests[i].tcname) != 0) {
+  tcname = tr_tcname(tr_all_array[_i]);
+  if (strcmp(tcname, master_tests[_i].tcname) != 0) {
     char *emsg = malloc (MAXSTR);
     snprintf(emsg, MAXSTR,"Expected %s, got %s",
-             master_tests[i].tcname, tcname);
+             master_tests[_i].tcname, tcname);
     fail(emsg);
     free(emsg);
-  }
+  } 
 }
 END_TEST
 
@@ -219,11 +219,11 @@
 START_TEST(test_check_all_msgs)
 {
   const char *msg;
-  msg = tr_msg(tr_all_array[i]);
-  if (strcmp(msg, master_tests[i].msg) != 0) {
+  msg = tr_msg(tr_all_array[_i]);
+  if (strcmp(msg, master_tests[_i].msg) != 0) {
     char *emsg = malloc (MAXSTR);
     snprintf(emsg, MAXSTR,"Expected %s, got %s",
-             master_tests[i].msg, msg);
+             master_tests[_i].msg, msg);
     fail(emsg);
     free(emsg);
   }
@@ -232,8 +232,8 @@
 
 START_TEST(test_check_all_ftypes)
 {
-  fail_unless(master_tests[i].failure_type == tr_rtype(tr_all_array[i]),
-              "Failure type wrong for test %d", i);
+  fail_unless(master_tests[_i].failure_type == tr_rtype(tr_all_array[_i]),
+              "Failure type wrong for test %d", _i);
 }
 END_TEST
 
Index: doc/check.texi
===================================================================
--- doc/check.texi      (revision 368)
+++ doc/check.texi      (revision 369)
@@ -1001,7 +1001,7 @@
 Adding a normal test with @code{tcase_add_loop_test()} instead of
 @code{tcase_add_test()} will make the test function the body of a
 @code{for} loop, with the addition of a fork before each call.  The
-loop variable @code{i} is available for use inside the test function;
+loop variable @code{_i} is available for use inside the test function;
 for example, it could serve as an index into a table.  For failures,
 the iteration which caused the failure is available in error messages
 and logs.  
@@ -1011,15 +1011,32 @@
 pseudo-code to show the concept:
 @example
 @verbatim
-for (i = tfun->loop_start; i < tfun->loop_end; i++)
+for (_i = tfun->loop_start; _i < tfun->loop_end; _i++)
 {
   fork();      /* New context */
-  tfun->f(i);  /* Call test function */
+  tfun->f(_i);  /* Call test function */
   wait();      /* Wait for child to terminate */
 }
 @end verbatim
 @end example
 
+An example of looping test usage follows:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+static const int primes[5] = {2,3,5,7,11};
+
+START_TEST (check_is_prime)
+{
+  fail_unless (is_prime (primes[_i]));
+}
+END_TEST
+
+...
+
+tcase_add_loop_test (tcase, check_is_prime, 0, 5);
[EMAIL PROTECTED] verbatim
[EMAIL PROTECTED] example
+
 Looping tests work in @code{CK_NOFORK} mode as well, but without the
 forking.  This means that only the first error will be shown.
 

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: check
Source-Version: 0.9.4-3

We believe that the bug you reported is fixed in the latest version of
check, which is due to be installed in the Debian FTP archive:

check_0.9.4-3.diff.gz
  to pool/main/c/check/check_0.9.4-3.diff.gz
check_0.9.4-3.dsc
  to pool/main/c/check/check_0.9.4-3.dsc
check_0.9.4-3_i386.deb
  to pool/main/c/check/check_0.9.4-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Robert Lemmen <[EMAIL PROTECTED]> (supplier of updated check package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 21 Dec 2006 21:03:44 +0100
Source: check
Binary: check
Architecture: source i386
Version: 0.9.4-3
Distribution: unstable
Urgency: high
Maintainer: Robert Lemmen <[EMAIL PROTECTED]>
Changed-By: Robert Lemmen <[EMAIL PROTECTED]>
Description: 
 check      - unit test framework for C
Closes: 404118
Changes: 
 check (0.9.4-3) unstable; urgency=high
 .
   * Fixed a bug that breaks all loop tests that use "i" as a variable name
     (closes: #404118)
Files: 
 f3e1d55900d4ef60309cfcfc492979bb 559 devel optional check_0.9.4-3.dsc
 c28269b1b1b241c89b95df0181dfcf2d 5146 devel optional check_0.9.4-3.diff.gz
 1f8a2ecf6f4a83fe19ce5ef5300920a4 94598 devel optional check_0.9.4-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFkFArXm3vHE4uyloRArVHAJ4qBB23OWM70FHQdw0KHTLuHALxDQCgiTkK
Dbxrdof68jXEOIKZSUAElrc=
=F0FQ
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to