MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/sha_test.cpp:9–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace Star;
8
9TEST(ShaTest, All) {
10 Sha256Hasher hasher;
11 List<ByteArray> computed;
12 List<ByteArray> expected;
13
14 computed.append(sha256("/animations/muzzleflash/bulletmuzzle1/bulletmuzzle1.png"));
15 expected.append(hexDecode("7e4a2cbe3826945d5f6593b347b49285b00ba8471cb4f6edc9b045c2cb3b6ea6"));
16 computed.append(sha256(""));
17 expected.append(hexDecode("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
18 computed.append(sha256("The quick brown fox jumped over the lazy dog."));
19 expected.append(hexDecode("68b1282b91de2c054c36629cb8dd447f12f096d3e3c587978dc2248444633483"));
20 computed.append(sha256("The quick brown fox jumped over the lazy dog"));
21 expected.append(hexDecode("7d38b5cd25a2baf85ad3bb5b9311383e671a8a142eb302b324d4a5fba8748c69"));
22 computed.append(sha256("1"));
23 expected.append(hexDecode("6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b"));
24 computed.append(sha256("22"));
25 expected.append(hexDecode("785f3ec7eb32f30b90cd0fcf3657d388b5ff4297f2f9716ff66e9b69c05ddd09"));
26 computed.append(sha256("333"));
27 expected.append(hexDecode("556d7dc3a115356350f1f9910b1af1ab0e312d4b3e4fc788d2da63668f36d017"));
28 computed.append(sha256("four"));
29 expected.append(hexDecode("04efaf080f5a3e74e1c29d1ca6a48569382cbbcd324e8d59d2b83ef21c039f00"));
30 computed.append(sha256("five5"));
31 expected.append(hexDecode("9caa1a017da4f2a1b836d0b4826549f651f3318bca4569af1d12549a92a3e0b0"));
32 computed.append(sha256("sixsix"));
33 expected.append(hexDecode("aec04bf8cf83291ceed3d47e8601e1989dc29ce76a6399264132de2731e69e55"));
34 computed.append(sha256("seven77"));
35 expected.append(hexDecode("363025b80362011c5f647eb99f029fc95f7df417a1aec169227a4fbb72f17f0f"));
36 computed.append(sha256("eight888"));
37 expected.append(hexDecode("ed13590c2bf3fc9df3a2f8631f117a70b67f6776480b9dd70125d1a4990e39f1"));
38 computed.append(sha256("nine char"));
39 expected.append(hexDecode("eb9d9e1b52a1e31daa806fbaf6db9b81ba1509cb933858af7ac73ba56e7d4c7f"));
40 computed.append(sha256("1010101010"));
41 expected.append(hexDecode("179b1a3e9e319cff0ca6671e07a62dad7d087b0f2a89eef0202612c3cb46baf9"));
42 computed.append(sha256("eleven char"));
43 expected.append(hexDecode("9734f6b41c8669fd1c6b5ad5ed8be0f733571933c7ec1bfe6061cc17944eeb48"));
44 computed.append(sha256("tweleve char"));
45 expected.append(hexDecode("219d8903ddaf708532901ac17f730b1f10a8a2aeb790ceb1e6883a8fa6960fc5"));
46 computed.append(sha256("thirteen char"));
47 expected.append(hexDecode("a7979658ac2830a4b39910c5eb8420b28dbf5a594210b102ff8faf76220c3895"));
48 computed.append(sha256("fourteen chars"));
49 expected.append(hexDecode("6099743911ee19e952125d8534ac0248bc1f83c87303ceef79e7c80e417c248a"));
50 computed.append(sha256("15 char long :)"));
51 expected.append(hexDecode("cc5b9b929c4e57a18c6e35191361a7d7eb825da773c13a006f71c4180acba379"));
52 computed.append(sha256("16 chars long :)"));
53 expected.append(hexDecode("5fb4f6a8d4a7f1918a94d8cf88e9efe893b7ce5dca92c6ff9c531eeb34192911"));
54 computed.append(sha256("seventeenseventee"));
55 expected.append(hexDecode("c86aa346db174a97bc41140be8778a17c305224a279c18c518c1213b5072d5ef"));
56 computed.append(sha256("eighteeneighteen:)"));
57 expected.append(hexDecode("686a19974520da4cde42bdfb930d63a147325c5461573c91adcd20aca3209b35"));
58 computed.append(sha256("19 char winner here"));
59 expected.append(hexDecode("f889777c4c1a74030e7db49e92f1d531d85638c04886c1605c90839b671a1f9e"));
60 computed.append(sha256("this is 20 char long"));
61 expected.append(hexDecode("95e85585cf3ebb0a8adb32f8a73663dc29bbe0e683bc44725af0f37b743f0afc"));
62 computed.append(sha256("this is 21 chars long"));
63 expected.append(hexDecode("64ce72b12e8e9dd32b5263d3ee69b3fb3122a040430b1626143a8ca14541cafc"));
64 computed.append(sha256("22 chars right here..."));
65 expected.append(hexDecode("a3799668feaef5fbaf693d6ae8202499397bd76ff1d0cf128f016bf9de1ab38c"));
66 computed.append(sha256("23 right here right now"));

Callers

nothing calls this directly

Calls 4

sha256Function · 0.85
hexDecodeFunction · 0.85
zipFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected