summaryrefslogtreecommitdiff
path: root/test/libapt
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt')
-rw-r--r--test/libapt/acqprogress_test.cc8
-rw-r--r--test/libapt/cdrom_test.cc4
-rw-r--r--test/libapt/cdromfindpackages_test.cc2
-rw-r--r--test/libapt/compareversion_test.cc4
-rw-r--r--test/libapt/extracttar_test.cc2
-rw-r--r--test/libapt/file-helpers.cc4
-rw-r--r--test/libapt/fileutl_test.cc8
-rw-r--r--test/libapt/getlanguages_test.cc4
-rw-r--r--test/libapt/getlistoffilesindir_test.cc4
-rw-r--r--test/libapt/globalerror_test.cc2
-rw-r--r--test/libapt/gtest_runner.cc2
-rw-r--r--test/libapt/hashsums_test.cc6
-rw-r--r--test/libapt/indexcopytosourcelist_test.cc2
-rw-r--r--test/libapt/parsedepends_test.cc4
-rw-r--r--test/libapt/priority_test.cc2
-rw-r--r--test/libapt/sourcelist_test.cc2
-rw-r--r--test/libapt/srvrecs_test.cc2
-rw-r--r--test/libapt/strutil_test.cc2
-rw-r--r--test/libapt/tagfile_test.cc2
-rw-r--r--test/libapt/tagsection_test.cc2
-rw-r--r--test/libapt/teestream_test.cc6
-rw-r--r--test/libapt/uri_test.cc2
22 files changed, 41 insertions, 35 deletions
diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc
index 0e82a285d..d4596c85d 100644
--- a/test/libapt/acqprogress_test.cc
+++ b/test/libapt/acqprogress_test.cc
@@ -1,12 +1,12 @@
#include <config.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/hashes.h>
#include <apt-private/acqprogress.h>
-#include <string>
-#include <sstream>
#include <gtest/gtest.h>
+#include <sstream>
+#include <string>
class TestItem: public pkgAcquire::Item
{
diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc
index b4c51cdb0..c9021e64e 100644
--- a/test/libapt/cdrom_test.cc
+++ b/test/libapt/cdrom_test.cc
@@ -1,13 +1,13 @@
#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/cdrom.h>
#include <apt-pkg/cdromutl.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
#include <string>
-#include <string.h>
#include <vector>
+#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/cdromfindpackages_test.cc b/test/libapt/cdromfindpackages_test.cc
index 0d8eb1f90..f6acf18fd 100644
--- a/test/libapt/cdromfindpackages_test.cc
+++ b/test/libapt/cdromfindpackages_test.cc
@@ -5,10 +5,10 @@
#include <apt-pkg/fileutl.h>
#include <algorithm>
+#include <iostream>
#include <string>
#include <vector>
#include <stddef.h>
-#include <iostream>
#include <gtest/gtest.h>
diff --git a/test/libapt/compareversion_test.cc b/test/libapt/compareversion_test.cc
index 3b2c0c209..1782c61cc 100644
--- a/test/libapt/compareversion_test.cc
+++ b/test/libapt/compareversion_test.cc
@@ -18,15 +18,15 @@
/*}}}*/
#include <config.h>
-#include <apt-pkg/error.h>
#include <apt-pkg/debversion.h>
+#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <fstream>
#include <string>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/wait.h>
+#include <unistd.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc
index 0255bd767..30934144a 100644
--- a/test/libapt/extracttar_test.cc
+++ b/test/libapt/extracttar_test.cc
@@ -3,8 +3,8 @@
#include <iostream>
#include <stdlib.h>
-#include <gtest/gtest.h>
#include "assert.h"
+#include <gtest/gtest.h>
class Stream : public pkgDirStream
{
diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc
index 48d8a9fbb..aa16a2e30 100644
--- a/test/libapt/file-helpers.cc
+++ b/test/libapt/file-helpers.cc
@@ -2,10 +2,10 @@
#include <string>
-#include <unistd.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
+#include <unistd.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index 67bd850a1..6cc850033 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -1,10 +1,10 @@
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/configuration.h>
#include <algorithm>
#include <string>
@@ -25,7 +25,9 @@ static void TestFileFd(mode_t const a_umask, mode_t const ExpectedFilePermission
static const char* fname = "apt-filefd-test.txt";
if (FileExists(fname) == true)
+ {
EXPECT_EQ(0, unlink(fname));
+ }
FileFd f;
umask(a_umask);
@@ -290,7 +292,9 @@ TEST(FileUtlTest, Popen)
// ensure that after a close all is good again
if(FileExists("/proc/self/fd"))
+ {
EXPECT_EQ(Glob("/proc/self/fd/*").size(), OpenFds.size());
+ }
// ReadWrite is not supported
_error->PushToStack();
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 29ff0c9ae..26ff66f72 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -10,9 +10,9 @@
#include <string>
#include <vector>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/getlistoffilesindir_test.cc b/test/libapt/getlistoffilesindir_test.cc
index 8c5e56b1d..606e2733e 100644
--- a/test/libapt/getlistoffilesindir_test.cc
+++ b/test/libapt/getlistoffilesindir_test.cc
@@ -1,11 +1,11 @@
#include <config.h>
-#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
#include <gtest/gtest.h>
diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc
index bb36905a4..67682c275 100644
--- a/test/libapt/globalerror_test.cc
+++ b/test/libapt/globalerror_test.cc
@@ -2,9 +2,9 @@
#include <apt-pkg/error.h>
-#include <stddef.h>
#include <string>
#include <errno.h>
+#include <stddef.h>
#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc
index 73854d976..5620aa0bd 100644
--- a/test/libapt/gtest_runner.cc
+++ b/test/libapt/gtest_runner.cc
@@ -1,9 +1,9 @@
#include <gtest/gtest.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
+#include <apt-pkg/pkgsystem.h>
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index fb9a25643..8b4533265 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -1,16 +1,16 @@
#include <config.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/fileutl.h>
#include <iostream>
-#include <stdlib.h>
#include <string>
+#include <stdlib.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc
index eb6d49edf..b0bfeb4b2 100644
--- a/test/libapt/indexcopytosourcelist_test.cc
+++ b/test/libapt/indexcopytosourcelist_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
#include <apt-pkg/indexcopy.h>
#include <string>
diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc
index c2781b5d6..ed849f768 100644
--- a/test/libapt/parsedepends_test.cc
+++ b/test/libapt/parsedepends_test.cc
@@ -1,11 +1,11 @@
#include <config.h>
-#include <apt-pkg/deblistparser.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/deblistparser.h>
#include <apt-pkg/pkgcache.h>
-#include <string.h>
#include <string>
+#include <string.h>
#include <gtest/gtest.h>
diff --git a/test/libapt/priority_test.cc b/test/libapt/priority_test.cc
index ef1941ce5..af7932ae8 100644
--- a/test/libapt/priority_test.cc
+++ b/test/libapt/priority_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
#include <apt-pkg/pkgcache.h>
-#include <string>
#include <gtest/gtest.h>
+#include <string>
using std::string;
diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc
index 83c441092..6182639a4 100644
--- a/test/libapt/sourcelist_test.cc
+++ b/test/libapt/sourcelist_test.cc
@@ -1,7 +1,7 @@
#include <config.h>
-#include <apt-pkg/sourcelist.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/sourcelist.h>
#include <string>
#include <stdlib.h>
diff --git a/test/libapt/srvrecs_test.cc b/test/libapt/srvrecs_test.cc
index 5253b1c34..4fcc96dae 100644
--- a/test/libapt/srvrecs_test.cc
+++ b/test/libapt/srvrecs_test.cc
@@ -77,7 +77,9 @@ TEST(SrvRecTest,Randomness)
EXPECT_TRUE(std::all_of(first_pull.begin(), first_pull.end(), [](SrvRec const &R) { return R.priority == 20; }));
EXPECT_TRUE(std::all_of(second_pull.begin(), second_pull.end(), [](SrvRec const &R) { return R.priority == 20; }));
if (startingClock != -1 && startingClock != clock())
+ {
EXPECT_FALSE(std::equal(first_pull.begin(), first_pull.end(), second_pull.begin()));
+ }
EXPECT_TRUE(std::all_of(base2.begin(), base2.end(), [](SrvRec const &R) { return R.priority == 30; }));
}
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index d7700bd54..9c192a58b 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -1,6 +1,6 @@
#include <config.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
#include <string>
#include <vector>
diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc
index 24fbd389e..fb85ebcad 100644
--- a/test/libapt/tagfile_test.cc
+++ b/test/libapt/tagfile_test.cc
@@ -3,11 +3,11 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
+#include <sstream>
#include <string>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sstream>
#include <gtest/gtest.h>
diff --git a/test/libapt/tagsection_test.cc b/test/libapt/tagsection_test.cc
index 779932595..d79b1b63d 100644
--- a/test/libapt/tagsection_test.cc
+++ b/test/libapt/tagsection_test.cc
@@ -3,8 +3,8 @@
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
-#include <string>
#include <sstream>
+#include <string>
#include <gtest/gtest.h>
diff --git a/test/libapt/teestream_test.cc b/test/libapt/teestream_test.cc
index 18610b24d..a897e08ec 100644
--- a/test/libapt/teestream_test.cc
+++ b/test/libapt/teestream_test.cc
@@ -1,9 +1,9 @@
#include <config.h>
-#include <string>
-#include <sstream>
-#include <fstream>
#include "../interactive-helper/teestream.h"
+#include <fstream>
+#include <sstream>
+#include <string>
#include <gtest/gtest.h>
diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc
index 09d018049..54f4f84f8 100644
--- a/test/libapt/uri_test.cc
+++ b/test/libapt/uri_test.cc
@@ -2,8 +2,8 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/proxy.h>
#include <apt-pkg/strutl.h>
-#include <string>
#include <gtest/gtest.h>
+#include <string>
TEST(URITest, BasicHTTP)
{