Skip to content

Commit f892d3d

Browse files
committed
Change 0xcafebabe to 0xc0ffee in tests
1 parent 61e98d7 commit f892d3d

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/test/java/org/scijava/options/OptionsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ public void testPersistence() {
9494
assertEquals(0, fooOptions.getBar());
9595

9696
// verify that we can set bar to a desired value at all
97-
fooOptions.setBar(0xcafebabe);
98-
assertEquals(0xcafebabe, fooOptions.getBar());
97+
fooOptions.setBar(0xc0ffee);
98+
assertEquals(0xc0ffee, fooOptions.getBar());
9999

100100
// verify that save and load work as expected in the same context
101101
fooOptions.save();
102102
fooOptions.setBar(0xdeadbeef);
103103
fooOptions.load();
104-
assertEquals(0xcafebabe, fooOptions.getBar());
104+
assertEquals(0xc0ffee, fooOptions.getBar());
105105

106106
// throw away the 1st context
107107
optionsService.getContext().dispose();
@@ -112,7 +112,7 @@ public void testPersistence() {
112112
final FooOptions fooOptions = optionsService.getOptions(FooOptions.class);
113113

114114
// verify that persisted values are loaded correctly in a new context
115-
assertEquals(0xcafebabe, fooOptions.getBar());
115+
assertEquals(0xc0ffee, fooOptions.getBar());
116116

117117
// clean up for next time
118118
fooOptions.reset(); // FIXME: If this test fails, reset will not happen!

src/test/java/org/scijava/util/DigestUtilsTest.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@
4141
*/
4242
public class DigestUtilsTest {
4343

44-
private static final byte[] CAFEBABE_SHA1 = { 20, 101, -38, -47, 38, -45, 43,
45-
-9, -86, 93, 59, -107, -91, -57, -61, 49, -51, -1, 52, -33 };
44+
private static final byte[] COFFEE_SHA1 = { -71, 2, 27, -126, -23, -70, -89,
45+
35, -65, -15, -108, 66, 72, 113, 29, -32, -12, -42, -49, 6 };
4646

47-
private static final byte[] CAFEBABE_MD5 = { 45, 27, -67, -30, -84, -84, 10,
48-
-3, 7, 100, 109, -104, 21, 79, 64, 46 };
47+
private static final byte[] COFFEE_MD5 = { -39, -98, 9, -40, -39, 44, 31,
48+
-62, 23, 9, 38, 101, 85, -57, 121, -110 };
4949

5050
private static final byte[] HELLO_WORLD_SHA1 = { 123, 80, 44, 58, 31, 72,
5151
-56, 96, -102, -30, 18, -51, -5, 99, -99, -18, 57, 103, 63, 94 };
5252

5353
private static final String HELLO_WORLD_SHA1_HEX =
5454
"7b502c3a1f48c8609ae212cdfb639dee39673f5e";
5555

56-
private static final String CAFEBABE_SHA1_HEX =
57-
"1465dad126d32bf7aa5d3b95a5c7c331cdff34df";
56+
private static final String COFFEE_SHA1_HEX =
57+
"b9021b82e9baa723bff1944248711de0f4d6cf06";
5858

5959
private static final String HELLO_WORLD_SHA1_BASE64 =
6060
"e1AsOh9IyGCa4hLN+2Od7jlnP14=";
6161

62-
private static final String CAFEBABE_SHA1_BASE64 =
63-
"FGXa0SbTK/eqXTuVpcfDMc3/NN8=";
62+
private static final String COFFEE_SHA1_BASE64 =
63+
"uQIbgum6pyO/8ZRCSHEd4PTWzwY=";
6464

6565
/** Tests {@link DigestUtils#bytes(String)}. */
6666
@Test
@@ -75,15 +75,15 @@ public void testBytesString() {
7575
/** Tests {@link DigestUtils#bytes(int)}. */
7676
@Test
7777
public void testBytesInt() {
78-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
79-
final byte[] expected = { -54, -2, -70, -66 };
78+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
79+
final byte[] expected = { 0, -64, -1, -18 };
8080
assertArrayEquals(expected, bytes);
8181
}
8282

8383
/** Tests {@link DigestUtils#hex(byte[])}. */
8484
@Test
8585
public void testHex() {
86-
assertEquals("cafebabe", DigestUtils.hex(DigestUtils.bytes(0xcafebabe)));
86+
assertEquals("00c0ffee", DigestUtils.hex(DigestUtils.bytes(0xc0ffee)));
8787
assertEquals("deadbeef", DigestUtils.hex(DigestUtils.bytes(0xdeadbeef)));
8888
assertEquals("00000000", DigestUtils.hex(DigestUtils.bytes(0x00000000)));
8989
assertEquals("ffffffff", DigestUtils.hex(DigestUtils.bytes(0xffffffff)));
@@ -92,7 +92,7 @@ public void testHex() {
9292
/** Tests {@link DigestUtils#base64(byte[])}. */
9393
@Test
9494
public void testBase64() {
95-
assertEquals("yv66vg==", DigestUtils.base64(DigestUtils.bytes(0xcafebabe)));
95+
assertEquals("AMD/7g==", DigestUtils.base64(DigestUtils.bytes(0xc0ffee)));
9696
assertEquals("3q2+7w==", DigestUtils.base64(DigestUtils.bytes(0xdeadbeef)));
9797
assertEquals("AAAAAA==", DigestUtils.base64(DigestUtils.bytes(0x00000000)));
9898
assertEquals("/////w==", DigestUtils.base64(DigestUtils.bytes(0xffffffff)));
@@ -118,23 +118,23 @@ public void testHashBytes() {
118118
/** Tests {@link DigestUtils#sha1(byte[])}. */
119119
@Test
120120
public void testSHA1() {
121-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
121+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
122122
final byte[] sha1 = DigestUtils.sha1(bytes);
123-
assertArrayEquals(CAFEBABE_SHA1, sha1);
123+
assertArrayEquals(COFFEE_SHA1, sha1);
124124
}
125125

126126
/** Tests {@link DigestUtils#md5(byte[])}. */
127127
@Test
128128
public void testMD5() {
129-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
129+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
130130
final byte[] md5 = DigestUtils.md5(bytes);
131-
assertArrayEquals(CAFEBABE_MD5, md5);
131+
assertArrayEquals(COFFEE_MD5, md5);
132132
}
133133

134134
/** Tests {@link DigestUtils#digest(String, byte[])}. */
135135
@Test
136136
public void testDigest() {
137-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
137+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
138138

139139
final byte[] sha1 = DigestUtils.digest("SHA-1", bytes);
140140
final byte[] expectedSHA1 = DigestUtils.sha1(bytes);
@@ -155,9 +155,9 @@ public void testBestString() {
155155
/** Tests {@link DigestUtils#best(byte[])}. */
156156
@Test
157157
public void testBestBytes() {
158-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
158+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
159159
final byte[] best = DigestUtils.best(bytes);
160-
assertArrayEquals(CAFEBABE_SHA1, best);
160+
assertArrayEquals(COFFEE_SHA1, best);
161161
}
162162

163163
/** Tests {@link DigestUtils#bestHex(String)}. */
@@ -169,8 +169,8 @@ public void testBestHexString() {
169169
/** Tests {@link DigestUtils#hex(byte[])}. */
170170
@Test
171171
public void testBestHexBytes() {
172-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
173-
assertEquals(CAFEBABE_SHA1_HEX, DigestUtils.bestHex(bytes));
172+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
173+
assertEquals(COFFEE_SHA1_HEX, DigestUtils.bestHex(bytes));
174174
}
175175

176176
/** Tests {@link DigestUtils#bestBase64(String)}. */
@@ -182,8 +182,8 @@ public void testBestBase64String() {
182182
/** Tests {@link DigestUtils#bestBase64(byte[])}. */
183183
@Test
184184
public void testBestBase64Bytes() {
185-
final byte[] bytes = DigestUtils.bytes(0xcafebabe);
186-
assertEquals(CAFEBABE_SHA1_BASE64, DigestUtils.bestBase64(bytes));
185+
final byte[] bytes = DigestUtils.bytes(0xc0ffee);
186+
assertEquals(COFFEE_SHA1_BASE64, DigestUtils.bestBase64(bytes));
187187
}
188188

189189
}

0 commit comments

Comments
 (0)