01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: HexFormatterTest.java,v 1.12.2.2 2008/01/07 15:14:34 cwl Exp $
07: */
08:
09: package com.sleepycat.je.util;
10:
11: import junit.framework.TestCase;
12:
13: import com.sleepycat.je.utilint.HexFormatter;
14:
15: /**
16: * Trivial formatting class that sticks leading 0's on the front of a hex
17: * number.
18: */
19: public class HexFormatterTest extends TestCase {
20: public void testFormatLong() {
21: assertTrue(HexFormatter.formatLong(0).equals(
22: "0x0000000000000000"));
23: assertTrue(HexFormatter.formatLong(1).equals(
24: "0x0000000000000001"));
25: assertTrue(HexFormatter.formatLong(0x1234567890ABCDEFL).equals(
26: "0x1234567890abcdef"));
27: assertTrue(HexFormatter.formatLong(0x1234567890L).equals(
28: "0x0000001234567890"));
29: assertTrue(HexFormatter.formatLong(0xffffffffffffffffL).equals(
30: "0xffffffffffffffff"));
31: }
32: }
|