[Ecm-commits] r2681 - trunk

cvs commits ecm-commits at lists.gforge.inria.fr
Tue Apr 7 11:16:25 CEST 2015


Author: zimmerma
Date: 2015-04-07 11:16:25 +0200 (Tue, 07 Apr 2015)
New Revision: 2681

Added:
   trunk/dummy.save
Modified:
   trunk/Makefile.am
   trunk/resume.c
   trunk/test.ecm
Log:
improve coverage
with -resume, now abort in case of corrupted line


Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2015-04-03 11:20:28 UTC (rev 2680)
+++ trunk/Makefile.am	2015-04-07 09:16:25 UTC (rev 2681)
@@ -110,7 +110,8 @@
              athlon/params.h x86/params.h ia64/params.h arm/params.h    \
              powerpc64/params.h powerpc32/params.h sparc64/params.h     \
              hppa/params.h mips/params.h x86_64/corei7/params.h         \
-             generic/params.h testlong.pp1 testlong.ecm M997.save M877.save
+             generic/params.h testlong.pp1 testlong.ecm M997.save M877.save \
+             dummy.save
 
 DIST_SUBDIRS = athlon pentium4 x86_64 powerpc64 aprtcle
 

Added: trunk/dummy.save
===================================================================
--- trunk/dummy.save	                        (rev 0)
+++ trunk/dummy.save	2015-04-07 09:16:25 UTC (rev 2681)
@@ -0,0 +1 @@
+METHOD ECM; PARAM=0; SIGMA=585928442; B1=174000; N=17061648125571273329563156588435816942778260706938821014533; X=0x1a2a694df04a5c037fd12f42668b474f16b7818933f4c8484; CHECKSUM=1505596339; PROGRAM=GMP-ECM 7.0-dev; Y=0x0; X0=0x0; Y0=0x0; WHO=zimmerma at tarte; TIME=Tue Apr  7 11:00:55 2015;


Property changes on: trunk/dummy.save
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/resume.c
===================================================================
--- trunk/resume.c	2015-04-03 11:20:28 UTC (rev 2680)
+++ trunk/resume.c	2015-04-07 09:16:25 UTC (rev 2681)
@@ -174,7 +174,8 @@
           
           if (!facceptstr (fd, "="))
             {
-              printf ("Save file line has no equal sign after: %s\n", tag);
+              fprintf (stderr, "Error, save file line has no '=' in: %s\n",
+                       tag);
               goto error;
             }
           
@@ -400,14 +401,13 @@
 
       return 1;
       
-error:
-      /* In case of error, read rest of line and try next line */
-      while (!facceptnl (fd) && !feof (fd))
-        fgetc (fd);
     }
     
     /* We hit EOF without reading a proper save line */
     return 0;
+
+error:
+    exit (EXIT_FAILURE);
 }
 
 

Modified: trunk/test.ecm
===================================================================
--- trunk/test.ecm	2015-04-03 11:20:28 UTC (rev 2680)
+++ trunk/test.ecm	2015-04-07 09:16:25 UTC (rev 2681)
@@ -206,6 +206,10 @@
 /bin/rm -f test.ecm.save
 checkcode $C 0
 
+$ECM -resume dummy.save 1e3
+C=$?
+checkcode $C 1
+
 echo 89101594496537524661600025466303491594098940711325290746374420963129505171895306244425914080753573576861992127359576789001 | $ECM -param 0 -sigma 877655087 -go 325001 157721 1032299; checkcode $? 14
 
 echo 5394204444759808120647321820789847518754252780933425517607611172590240019087317088600360602042567541009369753816111824690753627535877960715703346991252857 | $ECM -param 0 -sigma 805816989 -go 345551 149827; checkcode $? 6



More information about the Ecm-commits mailing list