summaryrefslogtreecommitdiff
path: root/test/libapt/acqprogress_test.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-16 16:22:46 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-06-16 16:22:46 +0200
commitc8a4ce6cbed57ae108dc955d4a850f9b129a0693 (patch)
tree8e22e692a95f2c4b17de7d0d8f91bf584616a144 /test/libapt/acqprogress_test.cc
parent533fe3d13927798c17bdef84eba60ed9441d9608 (diff)
add d-pointer, virtual destructors and de-inline de/constructors
To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore
Diffstat (limited to 'test/libapt/acqprogress_test.cc')
-rw-r--r--test/libapt/acqprogress_test.cc46
1 files changed, 26 insertions, 20 deletions
diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc
index c634733d4..dc31423fc 100644
--- a/test/libapt/acqprogress_test.cc
+++ b/test/libapt/acqprogress_test.cc
@@ -25,21 +25,23 @@ TEST(AcqProgress, IMSHit)
AcqTextStatus Stat(out, width, 0);
Stat.Start();
+ pkgAcquire Acq(&Stat);
pkgAcquire::ItemDesc hit;
hit.URI = "http://example.org/file";
hit.Description = "Example File from example.org";
hit.ShortDesc = "Example File";
- hit.Owner = NULL;
+ TestItem hitO(&Acq);
+ hit.Owner = &hitO;
EXPECT_EQ("", out.str());
Stat.IMSHit(hit);
- EXPECT_EQ("Hit Example File from example.org\n", out.str());
+ EXPECT_EQ("Hit:1 Example File from example.org\n", out.str());
Stat.IMSHit(hit);
- EXPECT_EQ("Hit Example File from example.org\n"
- "Hit Example File from example.org\n", out.str());
+ EXPECT_EQ("Hit:1 Example File from example.org\n"
+ "Hit:1 Example File from example.org\n", out.str());
Stat.Stop();
- EXPECT_EQ("Hit Example File from example.org\n"
- "Hit Example File from example.org\n", out.str());
+ EXPECT_EQ("Hit:1 Example File from example.org\n"
+ "Hit:1 Example File from example.org\n", out.str());
}
TEST(AcqProgress, FetchNoFileSize)
{
@@ -61,10 +63,10 @@ TEST(AcqProgress, FetchNoFileSize)
EXPECT_EQ("Get:1 Example File from example.org\n", out.str());
Stat.Fetch(fetch);
EXPECT_EQ("Get:1 Example File from example.org\n"
- "Get:2 Example File from example.org\n", out.str());
+ "Get:1 Example File from example.org\n", out.str());
Stat.Stop();
EXPECT_EQ("Get:1 Example File from example.org\n"
- "Get:2 Example File from example.org\n", out.str());
+ "Get:1 Example File from example.org\n", out.str());
}
TEST(AcqProgress, FetchFileSize)
{
@@ -88,10 +90,10 @@ TEST(AcqProgress, FetchFileSize)
fetchO.FileSize = 42;
Stat.Fetch(fetch);
EXPECT_EQ("Get:1 Example File from example.org [100 B]\n"
- "Get:2 Example File from example.org [42 B]\n", out.str());
+ "Get:1 Example File from example.org [42 B]\n", out.str());
Stat.Stop();
EXPECT_EQ("Get:1 Example File from example.org [100 B]\n"
- "Get:2 Example File from example.org [42 B]\n", out.str());
+ "Get:1 Example File from example.org [42 B]\n", out.str());
}
TEST(AcqProgress, Fail)
{
@@ -112,30 +114,34 @@ TEST(AcqProgress, Fail)
EXPECT_EQ("", out.str());
Stat.Fail(fetch);
- EXPECT_EQ("", out.str());
+ EXPECT_EQ("Ign:1 Example File from example.org\n", out.str());
fetchO.Status = pkgAcquire::Item::StatDone;
Stat.Fail(fetch);
- EXPECT_EQ("Ign Example File from example.org\n", out.str());
+ EXPECT_EQ("Ign:1 Example File from example.org\n"
+ "Ign:1 Example File from example.org\n", out.str());
fetchO.Status = pkgAcquire::Item::StatError;
fetchO.ErrorText = "An error test!";
Stat.Fail(fetch);
- EXPECT_EQ("Ign Example File from example.org\n"
- "Err Example File from example.org\n"
+ EXPECT_EQ("Ign:1 Example File from example.org\n"
+ "Ign:1 Example File from example.org\n"
+ "Err:1 Example File from example.org\n"
" An error test!\n", out.str());
_config->Set("Acquire::Progress::Ignore::ShowErrorText", true);
fetchO.Status = pkgAcquire::Item::StatDone;
Stat.Fail(fetch);
- EXPECT_EQ("Ign Example File from example.org\n"
- "Err Example File from example.org\n"
+ EXPECT_EQ("Ign:1 Example File from example.org\n"
+ "Ign:1 Example File from example.org\n"
+ "Err:1 Example File from example.org\n"
" An error test!\n"
- "Ign Example File from example.org\n"
+ "Ign:1 Example File from example.org\n"
" An error test!\n", out.str());
_config->Set("Acquire::Progress::Ignore::ShowErrorText", true);
Stat.Stop();
- EXPECT_EQ("Ign Example File from example.org\n"
- "Err Example File from example.org\n"
+ EXPECT_EQ("Ign:1 Example File from example.org\n"
+ "Ign:1 Example File from example.org\n"
+ "Err:1 Example File from example.org\n"
" An error test!\n"
- "Ign Example File from example.org\n"
+ "Ign:1 Example File from example.org\n"
" An error test!\n", out.str());
}
TEST(AcqProgress, Pulse)