diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-03-23 06:20:15 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-03-23 06:20:15 -0400 |
commit | d8199c88bfa5d3a4e13e1be0b032a166272239d8 (patch) | |
tree | 7a7a93b8cc73e8be58f07fed13479e3dbccc524a /validat0.cpp | |
parent | 1302bd5b452dac4ead89d55c9701d02c52882381 (diff) | |
download | cryptopp-git-d8199c88bfa5d3a4e13e1be0b032a166272239d8.tar.gz |
Update self tests
Diffstat (limited to 'validat0.cpp')
-rw-r--r-- | validat0.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/validat0.cpp b/validat0.cpp index 3e05ca16..68e73150 100644 --- a/validat0.cpp +++ b/validat0.cpp @@ -1603,9 +1603,9 @@ bool TestASN1Functions() std::cout << "DEREncodeTextString" << "\n";
}
-#if 0
{
- const SecByteBlock message = "Sun, 21 Mar 2021 01:00:00 +0000";
+ const byte date[] = "Sun, 21 Mar 2021 01:00:00 +0000";
+ SecByteBlock message; message.Assign(date, sizeof(date)-1);
const int asnDateTypes[] = {UTC_TIME, GENERALIZED_TIME};
unsigned int failed = 0;
size_t i = 0;
@@ -1613,9 +1613,9 @@ bool TestASN1Functions() for (i = 0; i < COUNTOF(asnDateTypes); ++i)
{
ByteQueue encoded, decoded;
- std::string recovered;
+ SecByteBlock recovered;
- (void)DEREncodeDate(encoded, ConstBytePtr(message), BytePtrSize(message), asnDateTypes[i]);
+ (void)DEREncodeDate(encoded, message, asnDateTypes[i]);
(void)BERDecodeDate(encoded, recovered, asnDateTypes[i]);
fail = (message != recovered);
@@ -1631,7 +1631,6 @@ bool TestASN1Functions() std::cout << (fail ? "FAILED" : "passed") << " ";
std::cout << "BERDecodeDate" << "\n";
}
-#endif
return pass;
}
|