19 package com.mysql.clusterj.tie;
21 import testsuite.clusterj.AbstractClusterJTest;
40 private void swapShort() {
41 short value = (short)0x9876;
42 short expected = (short)0x7698;
43 short actual = Utility.swap(value);
44 if (
getDebug()) System.out.println(
"swap(short) value: " + Integer.toHexString(0xffff & value) +
" expected: " + Integer.toHexString(expected) +
" actual: " + Integer.toHexString(actual));
45 errorIfNotEqual(
"swap(short) bad value", expected, actual);
48 private void swapInt() {
49 int value = 0x98765432;
50 int expected = 0x32547698;
51 int actual = Utility.swap(value);
52 if (
getDebug()) System.out.println(
"swap(int) value: " + Integer.toHexString(value) +
" expected: " + Integer.toHexString(expected) +
" actual: " + Integer.toHexString(actual));
53 errorIfNotEqual(
"swap(int) bad value", expected, actual);
56 private void swapLong() {
57 long value = Long.parseLong(
"01456789abcdef23", 16);
58 long expected = Long.parseLong(
"23efcdab89674501", 16);
59 long actual = Utility.swap(value);
60 if (
getDebug()) System.out.println(
"swap(long) value: " + Long.toHexString(value) +
" expected: " + Long.toHexString(expected) +
" actual: " + Long.toHexString(actual));
61 errorIfNotEqual(
"swap(long) bad value", expected, actual);