summaryrefslogtreecommitdiff
path: root/test/libapt
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt')
-rw-r--r--test/libapt/cdromfindpackages_test.cc4
-rw-r--r--test/libapt/cdromreducesourcelist_test.cc4
-rw-r--r--test/libapt/commandline_test.cc3
-rw-r--r--test/libapt/commandlineasstring_test.cc2
-rw-r--r--test/libapt/compareversion_test.cc9
-rw-r--r--test/libapt/configuration_test.cc2
-rw-r--r--test/libapt/fileutl_test.cc7
-rw-r--r--test/libapt/getarchitectures_test.cc5
-rw-r--r--test/libapt/getlanguages_test.cc2
-rw-r--r--test/libapt/getlistoffilesindir_test.cc7
-rw-r--r--test/libapt/globalerror_test.cc6
-rw-r--r--test/libapt/hashsums_test.cc15
-rw-r--r--test/libapt/indexcopytosourcelist_test.cc9
-rw-r--r--test/libapt/parsedepends_test.cc6
-rw-r--r--test/libapt/sourcelist_test.cc9
-rw-r--r--test/libapt/strutil_test.cc7
-rw-r--r--test/libapt/tagfile_test.cc6
-rw-r--r--test/libapt/uri_test.cc4
18 files changed, 77 insertions, 30 deletions
diff --git a/test/libapt/cdromfindpackages_test.cc b/test/libapt/cdromfindpackages_test.cc
index e9f5a51b0..583de1423 100644
--- a/test/libapt/cdromfindpackages_test.cc
+++ b/test/libapt/cdromfindpackages_test.cc
@@ -1,9 +1,13 @@
+#include <config.h>
+
#include <apt-pkg/cdrom.h>
#include <apt-pkg/error.h>
#include <algorithm>
#include <string>
#include <vector>
+#include <stddef.h>
+#include <iostream>
#include "assert.h"
diff --git a/test/libapt/cdromreducesourcelist_test.cc b/test/libapt/cdromreducesourcelist_test.cc
index b0314769d..196d0136e 100644
--- a/test/libapt/cdromreducesourcelist_test.cc
+++ b/test/libapt/cdromreducesourcelist_test.cc
@@ -1,7 +1,7 @@
+#include <config.h>
+
#include <apt-pkg/cdrom.h>
-#include <apt-pkg/error.h>
-#include <algorithm>
#include <string>
#include <vector>
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
index de8a30bd6..d8c5bc5bd 100644
--- a/test/libapt/commandline_test.cc
+++ b/test/libapt/commandline_test.cc
@@ -1,4 +1,7 @@
+#include <config.h>
+
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
#include "assert.h"
diff --git a/test/libapt/commandlineasstring_test.cc b/test/libapt/commandlineasstring_test.cc
index a38957d7e..5c005e956 100644
--- a/test/libapt/commandlineasstring_test.cc
+++ b/test/libapt/commandlineasstring_test.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
diff --git a/test/libapt/compareversion_test.cc b/test/libapt/compareversion_test.cc
index 44f8e9d78..43b98f240 100644
--- a/test/libapt/compareversion_test.cc
+++ b/test/libapt/compareversion_test.cc
@@ -16,17 +16,16 @@
##################################################################### */
/*}}}*/
-#include <apt-pkg/macros.h>
+#include <config.h>
+
#include <apt-pkg/error.h>
-#include <apt-pkg/version.h>
#include <apt-pkg/debversion.h>
#include <apt-pkg/fileutl.h>
-#include <iostream>
-#include <fstream>
+#include <fstream>
+#include <string>
#include <stdlib.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/wait.h>
using namespace std;
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index d2efc1b4b..c9235500c 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/configuration.h>
#include <string>
diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc
index d256ea55a..8da832ba9 100644
--- a/test/libapt/fileutl_test.cc
+++ b/test/libapt/fileutl_test.cc
@@ -1,14 +1,13 @@
+#include <config.h>
+
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include "assert.h"
#include <string>
#include <vector>
-
-#include <stdio.h>
-#include <iostream>
#include <stdlib.h>
+#include "assert.h"
int main()
{
diff --git a/test/libapt/getarchitectures_test.cc b/test/libapt/getarchitectures_test.cc
index 508d5e458..f4dfc6ae8 100644
--- a/test/libapt/getarchitectures_test.cc
+++ b/test/libapt/getarchitectures_test.cc
@@ -1,11 +1,12 @@
+#include <config.h>
+
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
-#include "assert.h"
#include <string>
#include <vector>
-#include <iostream>
+#include "assert.h"
int main()
{
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 51cfecee3..15aa4e879 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/configuration.h>
diff --git a/test/libapt/getlistoffilesindir_test.cc b/test/libapt/getlistoffilesindir_test.cc
index b2c95e840..df125fc83 100644
--- a/test/libapt/getlistoffilesindir_test.cc
+++ b/test/libapt/getlistoffilesindir_test.cc
@@ -1,12 +1,13 @@
+#include <config.h>
+
#include <apt-pkg/fileutl.h>
-#include "assert.h"
#include <string>
#include <vector>
-
-#include <stdio.h>
#include <iostream>
+#include "assert.h"
+
#define P(x) std::string(argv[1]).append("/").append(x)
int main(int argc,char *argv[])
diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc
index 742fa53bd..e913fdc12 100644
--- a/test/libapt/globalerror_test.cc
+++ b/test/libapt/globalerror_test.cc
@@ -1,10 +1,14 @@
+#include <config.h>
+
#include <apt-pkg/error.h>
-#include "assert.h"
+#include <stddef.h>
#include <string>
#include <errno.h>
#include <string.h>
+#include "assert.h"
+
int main()
{
std::string const textOfErrnoZero(strerror(0));
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index 410e2c44d..d743faec6 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -1,12 +1,15 @@
+#include <config.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 <stdio.h>
+#include <iostream>
+#include <stdlib.h>
+#include <string>
#include "assert.h"
@@ -50,22 +53,22 @@ int main(int argc, char** argv)
// test HashSumValue which doesn't calculate but just stores sums
{
- string md5sum = argv[2];
+ std::string md5sum = argv[2];
MD5SumValue md5(md5sum);
equals(md5.Value(), md5sum);
}
{
- string sha1sum = argv[3];
+ std::string sha1sum = argv[3];
SHA1SumValue sha1(sha1sum);
equals(sha1.Value(), sha1sum);
}
{
- string sha2sum = argv[4];
+ std::string sha2sum = argv[4];
SHA256SumValue sha2(sha2sum);
equals(sha2.Value(), sha2sum);
}
{
- string sha2sum = argv[5];
+ std::string sha2sum = argv[5];
SHA512SumValue sha2(sha2sum);
equals(sha2.Value(), sha2sum);
}
diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc
index 69d8fae86..e04ab261b 100644
--- a/test/libapt/indexcopytosourcelist_test.cc
+++ b/test/libapt/indexcopytosourcelist_test.cc
@@ -1,8 +1,11 @@
+#include <config.h>
+
#include <apt-pkg/configuration.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/indexcopy.h>
#include <string>
+#include <stdio.h>
#include "assert.h"
@@ -12,14 +15,14 @@ public:
IndexCopy::ConvertToSourceList(CD, Path);
return Path;
}
- bool GetFile(std::string &Filename,unsigned long long &Size) { return false; }
- bool RewriteEntry(FILE *Target,std::string File) { return false; }
+ bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) { return false; }
+ bool RewriteEntry(FILE * /*Target*/, std::string /*File*/) { return false; }
const char *GetFileName() { return NULL; }
const char *Type() { return NULL; }
};
-int main(int argc, char const *argv[]) {
+int main() {
NoCopy ic;
std::string const CD("/media/cdrom/");
diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc
index 5a2c65573..5564e2bc0 100644
--- a/test/libapt/parsedepends_test.cc
+++ b/test/libapt/parsedepends_test.cc
@@ -1,5 +1,11 @@
+#include <config.h>
+
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/configuration.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <string.h>
+#include <string>
#include "assert.h"
diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc
index 0637df03b..71aa54f1e 100644
--- a/test/libapt/sourcelist_test.cc
+++ b/test/libapt/sourcelist_test.cc
@@ -1,11 +1,16 @@
+#include <config.h>
+
+#include <apt-pkg/configuration.h>
#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/tagfile.h>
+#include <apt-pkg/fileutl.h>
-#include "assert.h"
+#include <string>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "assert.h"
+
char *tempfile = NULL;
int tempfile_fd = -1;
diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc
index a4516e7a1..618f4daba 100644
--- a/test/libapt/strutil_test.cc
+++ b/test/libapt/strutil_test.cc
@@ -1,5 +1,10 @@
+#include <config.h>
+
#include <apt-pkg/strutl.h>
+#include <string>
+#include <vector>
+
#include "assert.h"
int main()
@@ -44,7 +49,7 @@ int main()
// Split
input = "status: libnet1:amd64: unpacked";
- vector<std::string> result = StringSplit(input, ": ");
+ std::vector<std::string> result = StringSplit(input, ": ");
equals(result[0], "status");
equals(result[1], "libnet1:amd64");
equals(result[2], "unpacked");
diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc
index 24f258275..aaf46e3e9 100644
--- a/test/libapt/tagfile_test.cc
+++ b/test/libapt/tagfile_test.cc
@@ -1,11 +1,15 @@
+#include <config.h>
+
#include <apt-pkg/fileutl.h>
#include <apt-pkg/tagfile.h>
-#include "assert.h"
+#include <string>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "assert.h"
+
char *tempfile = NULL;
int tempfile_fd = -1;
diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc
index 8216ade71..6559f1390 100644
--- a/test/libapt/uri_test.cc
+++ b/test/libapt/uri_test.cc
@@ -1,5 +1,9 @@
+#include <config.h>
+
#include <apt-pkg/strutl.h>
+#include <string>
+
#include "assert.h"
int main() {