diff options
Diffstat (limited to 'test/libapt')
-rw-r--r-- | test/libapt/commandline_test.cc | 8 | ||||
-rw-r--r-- | test/libapt/gtest_runner.cc | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc index 627f1b486..0da2ba45f 100644 --- a/test/libapt/commandline_test.cc +++ b/test/libapt/commandline_test.cc @@ -96,7 +96,7 @@ TEST(CommandLineTest,GetCommand) char const * argv[] = { "apt-get", "-t", "unstable", "remove", "-d", "foo" }; char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv); EXPECT_STREQ("remove", com); - std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com); + std::vector<CommandLine::Args> Args = getCommandArgs(APT_CMD::APT_GET, com); ::Configuration c; CommandLine CmdL(Args.data(), &c); ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); @@ -110,7 +110,7 @@ TEST(CommandLineTest,GetCommand) char const * argv[] = {"apt-get", "-t", "unstable", "remove", "--", "-d", "foo" }; char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv); EXPECT_STREQ("remove", com); - std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com); + std::vector<CommandLine::Args> Args = getCommandArgs(APT_CMD::APT_GET, com); ::Configuration c; CommandLine CmdL(Args.data(), &c); ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); @@ -125,7 +125,7 @@ TEST(CommandLineTest,GetCommand) char const * argv[] = {"apt-get", "-t", "unstable", "--", "remove", "-d", "foo" }; char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv); EXPECT_STREQ("remove", com); - std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com); + std::vector<CommandLine::Args> Args = getCommandArgs(APT_CMD::APT_GET, com); ::Configuration c; CommandLine CmdL(Args.data(), &c); ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); @@ -140,7 +140,7 @@ TEST(CommandLineTest,GetCommand) char const * argv[] = {"apt-get", "install", "-t", "unstable", "--", "remove", "-d", "foo" }; char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv); EXPECT_STREQ("install", com); - std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com); + std::vector<CommandLine::Args> Args = getCommandArgs(APT_CMD::APT_GET, com); ::Configuration c; CommandLine CmdL(Args.data(), &c); ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv)); diff --git a/test/libapt/gtest_runner.cc b/test/libapt/gtest_runner.cc index 5823c55de..29f631326 100644 --- a/test/libapt/gtest_runner.cc +++ b/test/libapt/gtest_runner.cc @@ -1,5 +1,11 @@ #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); int result = RUN_ALL_TESTS(); |