summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-12 10:35:49 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-09-14 15:22:19 +0200
commit7414af7fa88164209eec9c585b8d175c1618ecbc (patch)
tree2a582637043bd8c57d43bf8b193dd9ecb479d559 /cmdline/apt-cache.cc
parent7c4f1ca5fe315a8223570b05994d6d7ca7c55c4f (diff)
various changes to increase test-coverage
And of course, testing obscure things ends up showing obscure 'bugs' or better shortcomings/inconsitencies, so lets fix them with the tests. Git-Dch: Ignore
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r--cmdline/apt-cache.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 1493b63dc..2db251350 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -312,13 +312,14 @@ static void ShowHashTableStats(std::string Type,
/* */
static bool Stats(CommandLine &CmdL)
{
- pkgCacheFile CacheFile;
- pkgCache *Cache = CacheFile.GetPkgCache();
-
if (CmdL.FileSize() > 1) {
_error->Error(_("apt-cache stats does not take any arguments"));
return false;
}
+
+ pkgCacheFile CacheFile;
+ pkgCache *Cache = CacheFile.GetPkgCache();
+
if (unlikely(Cache == NULL))
return false;