]> git.saurik.com Git - apt.git/commitdiff
tests: silence clang on uninitilized variables
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 5 Nov 2014 17:14:04 +0000 (18:14 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 8 Nov 2014 13:26:00 +0000 (14:26 +0100)
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

test/libapt/cdrom_test.cc
test/libapt/sourcelist_test.cc

index 5cf3b353cf1f450e7d7832867b838319389ed99d..7257eaf1b5aabb4179641ed949cda9f3f356346b 100644 (file)
@@ -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);
 }
index eb2d76c43d71d01883a41629c30d3be269470699..747ab4957f7eb374616ef00b1a6251aeb433ee63 100644 (file)
@@ -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"