Functions
sha1_test.cc File Reference
#include "cetlib/sha1.h"
#include <cstdlib>

Go to the source code of this file.

Functions

void ensure (int which, bool claim)
 
int main ()
 

Function Documentation

void ensure ( int  which,
bool  claim 
)

Definition at line 7 of file sha1_test.cc.

8 {
9  if (not claim)
10  std::exit(which);
11 }
int main ( void  )

Definition at line 14 of file sha1_test.cc.

15 {
16  typedef sha1::digest_t digest_t;
17 
18  {
19  sha1 d;
20  d.digest();
21  }
22 
23  {
24  sha1 d1("hi");
25  digest_t r1 = d1.digest();
26 
27  sha1 d2;
28  d2 << "hi";
29  digest_t r2 = d2.digest();
30 
31  sha1 d3('h');
32  d3 << 'i';
33  digest_t r3 = d3.digest();
34 
35  sha1 d4;
36  d4 << 'h' << 'i';
37  digest_t r4 = d4.digest();
38 
39  ensure(1, r1 == r2);
40  ensure(2, r1 == r3);
41  ensure(3, r1 == r4);
42  }
43 
44  return 0;
45 
46 } // main()
Definition: sha1.h:26
digest_t digest()
Definition: sha1.cc:45
void ensure(int which, bool claim)
Definition: sha1_test.cc:7