diff options
Diffstat (limited to 'test')
24 files changed, 114 insertions, 49 deletions
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index fb9f7d34e..34476e1af 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -1,27 +1,29 @@ #include <config.h> -#include <apt-pkg/strutl.h> -#include <apt-pkg/fileutl.h> -#include <apt-pkg/error.h> #include <apt-pkg/cmndline.h> #include <apt-pkg/configuration.h> -#include <apt-pkg/init.h> - -#include <vector> -#include <string> -#include <list> -#include <sstream> +#include <apt-pkg/error.h> +#include <apt-pkg/fileutl.h> +#include <apt-pkg/strutl.h> +#include <dirent.h> +#include <errno.h> +#include <netinet/in.h> +#include <pthread.h> +#include <regex.h> +#include <signal.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> #include <sys/socket.h> -#include <sys/types.h> #include <sys/stat.h> -#include <netinet/in.h> -#include <unistd.h> -#include <errno.h> #include <time.h> -#include <stdlib.h> -#include <dirent.h> -#include <signal.h> +#include <unistd.h> +#include <iostream> +#include <sstream> +#include <list> +#include <string> +#include <vector> static char const * httpcodeToStr(int const httpcode) /*{{{*/ { diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc index 94fe9dca8..852ec4ee9 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -1,7 +1,10 @@ +#include <config.h> + #include <apt-pkg/debfile.h> #include <apt-pkg/error.h> #include <apt-pkg/fileutl.h> +#include <string> #include <iostream> #include <unistd.h> diff --git a/test/interactive-helper/mthdcat.cc b/test/interactive-helper/mthdcat.cc index 25d09a3f5..2961b2080 100644 --- a/test/interactive-helper/mthdcat.cc +++ b/test/interactive-helper/mthdcat.cc @@ -2,6 +2,8 @@ All this does is cat a file into the method without closing the FD when the file ends */ +#include <config.h> + #include <unistd.h> int main() diff --git a/test/interactive-helper/rpmver.cc b/test/interactive-helper/rpmver.cc index 15c96cbbe..017c92fba 100644 --- a/test/interactive-helper/rpmver.cc +++ b/test/interactive-helper/rpmver.cc @@ -1,3 +1,5 @@ +#include <config.h> + #include <apt-pkg/debversion.h> #include <rpm/rpmio.h> #include <rpm/misc.h> diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc index 88f5f0153..b87dcd935 100644 --- a/test/interactive-helper/test_udevcdrom.cc +++ b/test/interactive-helper/test_udevcdrom.cc @@ -1,7 +1,10 @@ +#include <config.h> + #include <apt-pkg/cdrom.h> -#include <stdio.h> -#include <assert.h> +#include <stddef.h> +#include <string> +#include <assert.h> #include <vector> #include <iostream> @@ -17,5 +20,4 @@ int main() std::cerr << l[i].DeviceName << " " << l[i].Mounted << " " << l[i].MountPath << std::endl; - } diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc index 9520d1b50..6aae9f563 100644 --- a/test/interactive-helper/testdeb.cc +++ b/test/interactive-helper/testdeb.cc @@ -1,7 +1,14 @@ +#include <config.h> + #include <apt-pkg/dirstream.h> #include <apt-pkg/debfile.h> #include <apt-pkg/error.h> #include <apt-pkg/extracttar.h> +#include <apt-pkg/arfile.h> +#include <apt-pkg/fileutl.h> + +#include <iostream> +#include <string> class NullStream : public pkgDirStream { 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() { |