Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
test
sha1_test.cc
Go to the documentation of this file.
1
#include "
cetlib/sha1.h
"
2
#include <cstdlib>
3
4
using
cet::sha1
;
5
6
void
7
ensure
(
int
which,
bool
claim)
8
{
9
if
(not claim)
10
std::exit(which);
11
}
12
13
int
14
main
()
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()
main
int main()
Definition:
sha1_test.cc:14
cet::sha1
Definition:
sha1.h:26
bump_copyright.d
string d
Definition:
bump_copyright.py:70
cet::sha1::digest
digest_t digest()
Definition:
sha1.cc:45
ensure
void ensure(int which, bool claim)
Definition:
sha1_test.cc:7
sha1.h
Generated by
1.8.11