summaryrefslogtreecommitdiff
path: root/test/libapt
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2022-04-22 17:05:36 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2022-05-07 10:45:44 +0200
commit320245536a7ad21606286d9dcf54acf3bdf096c6 (patch)
tree839e81d85af6e50e8e8217717e160f41f0946ba1 /test/libapt
parente5aa5c04ecbd3cdab611794cebf9eb3aa8cbddd4 (diff)
Include our config.h in all C++ files to avoid ODR violations
Some of our headers use APT_COMPILING_APT trickery to avoid exposing too broadly details we don't want external clients to know and make use of. The flip-side is that this can lead to different compilation units seeing different definitions if they aren't all using the same config.
Diffstat (limited to 'test/libapt')
-rw-r--r--test/libapt/extracttar_test.cc2
-rw-r--r--test/libapt/file-helpers.cc2
-rw-r--r--test/libapt/gtest_runner.cc4
3 files changed, 7 insertions, 1 deletions
diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc
index ae74341e6..c945a0c68 100644
--- a/test/libapt/extracttar_test.cc
+++ b/test/libapt/extracttar_test.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/error.h>
#include <apt-pkg/dirstream.h>
#include <apt-pkg/extracttar.h>
diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc
index 85fc6838e..bb7052b2a 100644
--- a/test/libapt/file-helpers.cc
+++ b/test/libapt/file-helpers.cc
@@ -1,3 +1,5 @@
+#include <config.h>
+
#include <apt-pkg/fileutl.h>
#include <string>
diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc
index 5620aa0bd..09fc55d92 100644
--- a/test/libapt/gtest_runner.cc
+++ b/test/libapt/gtest_runner.cc
@@ -1,10 +1,12 @@
-#include <gtest/gtest.h>
+#include <config.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/pkgsystem.h>
+#include <gtest/gtest.h>
+
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
if (pkgInitSystem(*_config, _system) == false)