Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HaloFour committed Jan 15, 2025
1 parent 2900513 commit 820c1aa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ class Fnv1aChecksummerTest extends NiceTest {
val referenceBytes = "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash".getBytes
assert(-2758076559093427003L === underTest.checksum(referenceBytes))
}

it ("validates the checksum") {
val referenceBytes = "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash".getBytes
assert(true === underTest.validate(referenceBytes, -2758076559093427003L))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.comcast.xfinity.sirius.uberstore.common

import com.comcast.xfinity.sirius.NiceTest

class SkipValidationChecksummerTest extends NiceTest {
val underTest = new Object with Fnv1aChecksummer with SkipValidationChecksummer

it ("must match the reference impl") {
// from:
// http://trac.tools.ietf.org/wg/tls/draft-ietf-tls-cached-info/draft-ietf-tls-cached-info-06-from-05.diff.txt
val referenceBytes = "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash".getBytes
assert(-2758076559093427003L === underTest.checksum(referenceBytes))
}

it ("skips validating the checksum") {
val referenceBytes = "http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash".getBytes
assert(true === underTest.validate(referenceBytes, 0L))
}
}

0 comments on commit 820c1aa

Please sign in to comment.