Bläddra i källkod

tests: silence clang on uninitilized variables

The testcases have far worse problems if these ever end up being NULL
and/or are not given a value by the method called, but clang is right to
warn about it, just that we don't want to fix it in testcases…

Git-Dch: Ignore
David Kalnischkies 11 år sedan
förälder
incheckning
4234d90d58
2 ändrade filer med 3 tillägg och 2 borttagningar
  1. 2 1
      test/libapt/cdrom_test.cc
  2. 1 1
      test/libapt/sourcelist_test.cc

+ 2 - 1
test/libapt/cdrom_test.cc

@@ -109,6 +109,7 @@ TEST(CDROMTest, FindMountPointForDevice)
    EXPECT_EQ("/boot/efi", FindMountPointForDevice("/dev/sda1"));
    EXPECT_EQ("/tmp", FindMountPointForDevice("tmpfs"));
 
-   unlink(tempfile);
+   if (tempfile !=  NULL)
+      unlink(tempfile);
    free(tempfile);
 }

+ 1 - 1
test/libapt/sourcelist_test.cc

@@ -20,7 +20,7 @@ class SourceList : public pkgSourceList {
 TEST(SourceListTest,ParseFileDeb822)
 {
    FileFd fd;
-   char * tempfile;
+   char * tempfile = NULL;
    createTemporaryFile("parsefiledeb822", fd, &tempfile,
       "Types: deb\n"
       "URIs: http://ftp.debian.org/debian\n"