summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-06-29 12:45:30 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-06-29 12:45:30 +0100
commit9abccf4a63b6c887b213678d940fe912233f04c3 (patch)
tree8a22c910a0c8258f29784614aca9c0ebd2cc32d6 /test
parentc56c4b82dd77258da5640bf9f63a8db10424b59a (diff)
parent627e99b0328e05b13600134655253d36575f314d (diff)
merge lp:~mvo/apt/abi-break
Diffstat (limited to 'test')
-rw-r--r--test/hash.cc26
-rwxr-xr-xtest/integration/test-handling-broken-orgroups4
-rwxr-xr-xtest/integration/test-release-candidate-switching2
3 files changed, 22 insertions, 10 deletions
diff --git a/test/hash.cc b/test/hash.cc
index cfdb4ea9d..88f09fca0 100644
--- a/test/hash.cc
+++ b/test/hash.cc
@@ -1,6 +1,6 @@
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
-#include <apt-pkg/sha256.h>
+#include <apt-pkg/sha2.h>
#include <apt-pkg/strutl.h>
#include <iostream>
@@ -10,9 +10,17 @@ template <class T> void Test(const char *In,const char *Out)
{
T Sum;
Sum.Add(In);
- cout << Sum.Result().Value() << endl;
- if (stringcasecmp(Sum.Result().Value(),Out) != 0)
+
+ cout << "expected: '" << Out << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ cout << "got : '" << Sum.Result().Value() << "'" << endl;
+ if (stringcasecmp(Sum.Result().Value(), Out) != 0) {
+ cout << "FAIL" << endl << endl;
abort();
+ } else {
+ cout << "PASS" << endl << endl;
+ }
}
template <class T> void TestMill(const char *Out)
@@ -34,9 +42,8 @@ template <class T> void TestMill(const char *Out)
Count = 0;
}
}
-
- cout << Sum.Result().Value() << endl;
- if (stringcasecmp(Sum.Result().Value(),Out) != 0)
+
+ if (stringcasecmp(Sum.Result().Value(), Out) != 0)
abort();
}
@@ -62,8 +69,13 @@ int main()
// SHA-256, From FIPS 180-2
Test<SHA256Summation>("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
-
+ // SHA-512, From
+ Test<SHA512Summation>(
+ "abc",
+ "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a"
+ "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f");
+
return 0;
}
diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups
index d88ad0000..20b314074 100755
--- a/test/integration/test-handling-broken-orgroups
+++ b/test/integration/test-handling-broken-orgroups
@@ -58,7 +58,7 @@ The following information may help to resolve the situation:
The following packages have unmet dependencies:
coolstuff-broken : Depends: cool2 but it is not installable or
stuff2 but it is not installable
-E: Broken packages' aptget install coolstuff-broken -s
+E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s
testequal 'Reading package lists...
Building dependency tree...
@@ -105,4 +105,4 @@ The following information may help to resolve the situation:
The following packages have unmet dependencies:
coolstuff-provided-broken : Depends: cool2 but it is not installable or
stuff-abi-2
-E: Broken packages' aptget install coolstuff-provided-broken -s
+E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s
diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching
index b6dbe99db..0970cb935 100755
--- a/test/integration/test-release-candidate-switching
+++ b/test/integration/test-release-candidate-switching
@@ -416,4 +416,4 @@ The following information may help to resolve the situation:
The following packages have unmet dependencies:
uninstallablepkg : Depends: libmtp8 (>= 10:0.20.1) but it is not going to be installed
Depends: amarok-utils (= 2.3.2-2+exp) but 2.3.1-1+sid is to be installed
-E: Broken packages" aptget install uninstallablepkg/experimental --trivial-only -V -q=0
+E: Unable to correct problems, you have held broken packages." aptget install uninstallablepkg/experimental --trivial-only -V -q=0