diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-10-26 11:42:32 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-11-04 18:04:04 +0100 |
commit | 6079b276a959086ff18302cab752b6d7cfe5ad9f (patch) | |
tree | 151f75397170a05635202a604dd45d1fb9be85ca /test/libapt | |
parent | 011188e3920f21e6883c2dab956b3d4fb4e8cbfa (diff) |
move apts cmdline helper type into -private
Its not as simple as I initially thought to abstract this enough to make
it globally usable, so lets not pollute global namespace with this for
now.
Git-Dch: Ignore
Diffstat (limited to 'test/libapt')
-rw-r--r-- | test/libapt/commandline_test.cc | 14 | ||||
-rw-r--r-- | test/libapt/gtest_runner.cc | 4 |
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); |