diff options
Diffstat (limited to 'library/cpp/digest/md5/md5_ut.cpp')
-rw-r--r-- | library/cpp/digest/md5/md5_ut.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/digest/md5/md5_ut.cpp b/library/cpp/digest/md5/md5_ut.cpp index 1c3e4ad0a9..9c466eab00 100644 --- a/library/cpp/digest/md5/md5_ut.cpp +++ b/library/cpp/digest/md5/md5_ut.cpp @@ -8,7 +8,7 @@ Y_UNIT_TEST_SUITE(TMD5Test) { Y_UNIT_TEST(TestMD5) { // echo -n 'qwertyuiopqwertyuiopasdfghjklasdfghjkl' | md5sum - constexpr const char* b = "qwertyuiopqwertyuiopasdfghjklasdfghjkl"; + constexpr const char* b = "qwertyuiopqwertyuiopasdfghjklasdfghjkl"; MD5 r; r.Update((const unsigned char*)b, 15); @@ -20,7 +20,7 @@ Y_UNIT_TEST_SUITE(TMD5Test) { UNIT_ASSERT_NO_DIFF(s, TStringBuf("3ac00dd696b966fd74deee3c35a59d8f")); - TString result = r.Calc(TStringBuf(b)); + TString result = r.Calc(TStringBuf(b)); result.to_lower(); UNIT_ASSERT_NO_DIFF(result, TStringBuf("3ac00dd696b966fd74deee3c35a59d8f")); } @@ -51,12 +51,12 @@ Y_UNIT_TEST_SUITE(TMD5Test) { Y_UNIT_TEST(TestIsMD5) { UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf())); - UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa0"))); // length 31 - UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa000"))); // length 33 - UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa0g"))); // wrong character 'g' - UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136EBB0E4C45D21E2B09294C75CFA08"))); - UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136ebb0E4C45D21e2b09294C75CfA08"))); - UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa08"))); + UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa0"))); // length 31 + UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa000"))); // length 33 + UNIT_ASSERT_EQUAL(false, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa0g"))); // wrong character 'g' + UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136EBB0E4C45D21E2B09294C75CFA08"))); + UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136ebb0E4C45D21e2b09294C75CfA08"))); + UNIT_ASSERT_EQUAL(true, MD5::IsMD5(TStringBuf("4136ebb0e4c45d21e2b09294c75cfa08"))); } Y_UNIT_TEST(TestMd5HalfMix) { |