diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-07-17 16:22:56 +0200 |
---|---|---|
committer | Saša Živkov <sasa.zivkov@sap.com> | 2016-02-04 17:49:42 +0100 |
commit | 536db18cc62afab2d38aac5b2af73f575f40d8b6 (patch) | |
tree | 94dccd9b5a11010044efd27f126bd21a94d5a665 /org.eclipse.jgit.test/tst/org/eclipse/jgit/util | |
parent | 2de33d7678ffe865e44fc5007ee5fc59afa03404 (diff) | |
download | jgit-536db18cc62afab2d38aac5b2af73f575f40d8b6.tar.gz jgit-536db18cc62afab2d38aac5b2af73f575f40d8b6.zip |
Implement SHA-256 abstraction
The Large File Storage extension specified by GitHub [1] uses SHA-256 to
compute the ID of large files stored by the extension. Hence implement a
SHA-256 abstraction similar to the SHA-1 abstraction used by JGit.
[1] https://git-lfs.github.com/
Bug: 470333
Change-Id: I3a95954543c8570d73929e55f4a884b55dbf1b7a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java index 06cb11b37a..7e11a61035 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/NBTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, Google Inc. + * Copyright (C) 2008, 2015 Google Inc. * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -61,6 +61,17 @@ public class NBTest { } @Test + public void testCompareUInt64() { + assertTrue(NB.compareUInt64(0, 0) == 0); + assertTrue(NB.compareUInt64(1, 0) > 0); + assertTrue(NB.compareUInt64(0, 1) < 0); + assertTrue(NB.compareUInt64(-1, 0) > 0); + assertTrue(NB.compareUInt64(0, -1) < 0); + assertTrue(NB.compareUInt64(-1, 1) > 0); + assertTrue(NB.compareUInt64(1, -1) < 0); + } + + @Test public void testDecodeUInt16() { assertEquals(0, NB.decodeUInt16(b(0, 0), 0)); assertEquals(0, NB.decodeUInt16(padb(3, 0, 0), 3)); |