]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: All update tests should use unique temporary file names and cleanup.
authorMark Wielaard <mjw@redhat.com>
Sat, 27 Apr 2013 22:54:17 +0000 (00:54 +0200)
committerMark Wielaard <mjw@redhat.com>
Sat, 27 Apr 2013 22:56:23 +0000 (00:56 +0200)
All update tests used the same temporary file name xxx. And only update4
would clean up this file. Now that tests can run in parallel make sure
all temporary names are unique and every test cleans up their own files.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/update1.c
tests/update2.c
tests/update3.c
tests/update4.c

index dfee832f2f0410986849e2543965371a160e2496..e6722dacec477cc089ff60f48397ee905d4f21ef 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-27  Mark Wielaard  <mjw@redhat.com>
+
+       * update1.c (main): Use unique tempfile name and unlink file.
+       * update2.c (main): Likewise.
+       * update3.c (main): Likewise.
+       * update4.c (main): Use unique tempfile name.
+
 2013-04-27  Mark Wielaard  <mjw@redhat.com>
 
        * run-alldts.sh: Add testfile-alldts to tempfiles.
index 9e40686e5382769fc5654db8848108771e8c10d6..f4c1475372123c05109f0dd243360ec538807fd0 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 
 int
 main (int argc, char *argv[] __attribute__ ((unused)))
 {
-  const char *fname = "xxx";
+  const char *fname = "xxx_update1";
   int fd;
   Elf *elf;
   Elf32_Ehdr *ehdr;
@@ -120,5 +121,7 @@ main (int argc, char *argv[] __attribute__ ((unused)))
       exit (1);
     }
 
+  unlink (fname);
+
   return 0;
 }
index 42326943ad7513c523805ac38e43405cecf5b13c..5805163d8607f76f223e9a4a62f0209cdbd1de48 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 
 int
 main (int argc, char *argv[] __attribute__ ((unused)))
 {
-  const char *fname = "xxx";
+  const char *fname = "xxx_update2";
   int fd;
   Elf *elf;
   Elf32_Ehdr *ehdr;
@@ -143,5 +144,7 @@ main (int argc, char *argv[] __attribute__ ((unused)))
       exit (1);
     }
 
+  unlink (fname);
+
   return 0;
 }
index 1a62b34bd717166af1776c817d208f5ff6bda663..d760687a08614552fc7cb1f5e538464147d8ed9b 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include ELFUTILS_HEADER(ebl)
 
@@ -33,7 +34,7 @@
 int
 main (int argc, char *argv[] __attribute__ ((unused)))
 {
-  const char *fname = "xxx";
+  const char *fname = "xxx_update3";
   int fd;
   Elf *elf;
   Elf32_Ehdr *ehdr;
@@ -198,5 +199,7 @@ main (int argc, char *argv[] __attribute__ ((unused)))
       exit (1);
     }
 
+  unlink (fname);
+
   return 0;
 }
index f5f91e3189b0aa04f15a01a3c01213e9da31f67a..85de6c35f9e96985ccf757a3a01ffca30b376431 100644 (file)
@@ -34,7 +34,7 @@
 int
 main (int argc, char *argv[] __attribute__ ((unused)))
 {
-  const char fname[] = "xxx";
+  const char fname[] = "xxx_update4";
   int fd;
   Elf *elf;
   Elf32_Ehdr *ehdr;