summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/libapt/commandline_test.cc14
-rw-r--r--test/libapt/gtest_runner.cc4
2 files changed, 9 insertions, 9 deletions
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
index 0da2ba45f..7f6c511df 100644
--- a/test/libapt/commandline_test.cc
+++ b/test/libapt/commandline_test.cc
@@ -17,18 +17,22 @@ class CLT: public CommandLine {
}
};
-#define EXPECT_CMD(x, ...) { const char * const argv[] = { __VA_ARGS__ }; EXPECT_EQ(x, CLT::AsString(argv, sizeof(argv)/sizeof(argv[0]))); }
+bool ShowHelp(CommandLine &, aptDispatchWithHelp const *) {return false;}
+std::vector<aptDispatchWithHelp> GetCommands() {return {};}
+
TEST(CommandLineTest,SaveInConfig)
{
- EXPECT_CMD("apt-get install -sf",
+#define APT_EXPECT_CMD(x, ...) { const char * const argv[] = { __VA_ARGS__ }; EXPECT_EQ(x, CLT::AsString(argv, sizeof(argv)/sizeof(argv[0]))); }
+ APT_EXPECT_CMD("apt-get install -sf",
"apt-get", "install", "-sf");
- EXPECT_CMD("apt-cache -s apt -so Debug::test=Test",
+ APT_EXPECT_CMD("apt-cache -s apt -so Debug::test=Test",
"apt-cache", "-s", "apt", "-so", "Debug::test=Test");
- EXPECT_CMD("apt-cache -s apt -so Debug::test=\"Das ist ein Test\"",
+ APT_EXPECT_CMD("apt-cache -s apt -so Debug::test=\"Das ist ein Test\"",
"apt-cache", "-s", "apt", "-so", "Debug::test=Das ist ein Test");
- EXPECT_CMD("apt-cache -s apt --hallo test=1.0",
+ APT_EXPECT_CMD("apt-cache -s apt --hallo test=1.0",
"apt-cache", "-s", "apt", "--hallo", "test=1.0");
+#undef APT_EXPECT_CMD
}
TEST(CommandLineTest,Parsing)
{
diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc
index 29f631326..46054afa3 100644
--- a/test/libapt/gtest_runner.cc
+++ b/test/libapt/gtest_runner.cc
@@ -1,10 +1,6 @@
#include <gtest/gtest.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/cmndline.h>
-
-bool ShowHelp(CommandLine &, CommandLine::DispatchWithHelp const *) {return false;}
-std::vector<CommandLine::DispatchWithHelp> GetCommands() {return {};}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);