-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cc
29 lines (23 loc) · 1.31 KB
/
test.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#define CATCH_CONFIG_MAIN
#include "catch/catch_amalgamated.hpp"
#include "pwncheck.hh"
#include <iostream>
TEST_CASE("SortedSHA1Search", "SortedSHA1Search") {
SortedSHA1Search ssha1;
REQUIRE(ssha1.Open("sample-pwnd-passwords.txt"));
REQUIRE(SHA1("test") == "A94A8FE5CCB19BA61C4C0873D391E987982FBBD3");
REQUIRE(ssha1.ValCount("test") == 83045);
REQUIRE(ssha1.ValCount("p4ssw0rd") == 23586);
REQUIRE(ssha1.HashCount("000000000AD76BD555C1D6D771DE417A4B87E4B4") == 0);
REQUIRE(ssha1.HashCount("000000005AD76BD555C1D6D771DE417A4B87E4B4") == 4);
REQUIRE(ssha1.HashCount("00000000A8DAE4228F821FB418F59826079BF368") == 3);
REQUIRE(ssha1.HashCount("00000000DD7F2A1C68A35673713783CA390C9E93") == 630);
REQUIRE(ssha1.HashCount("00000001E225B908BAC31C56DB04D892E47536E0") == 5);
REQUIRE(ssha1.HashCount("00000002E225B908BAC31C56DB04D892E47536E0") == 0);
REQUIRE(ssha1.HashCount("FFFFFFF0A63ACC70BEA924C5DBABEE4B9B18C82D") == 0);
REQUIRE(ssha1.HashCount("FFFFFFF1A63ACC70BEA924C5DBABEE4B9B18C82D") == 10);
REQUIRE(ssha1.HashCount("FFFFFFF1C5E0CEFF1E36FB497985FCA1A3FB772C") == 1);
REQUIRE(ssha1.HashCount("FFFFFFF8A0382AA9C8D9536EFBA77F261815334D") == 12);
REQUIRE(ssha1.HashCount("FFFFFFFEE791CBAC0F6305CAF0CEE06BBE131160") == 2);
REQUIRE(ssha1.HashCount("FFFFFFFFE791CBAC0F6305CAF0CEE06BBE131160") == 0);
}