/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* Type-specific source code for unit test
*
* Regenerate the BasicX classes via genBasic.sh whenever this file changes.
* We check in the generated source files so that the test tree can be used
* independently of the rest of the source tree.
*/
// -- This file was mechanically generated: Do not edit! -- //
public class BasicDouble
extends Basic
{
private static final double[] VALUES = {
(double) -1,
(double) 0,
(double) 1,
(double) -0.0,
};
int n = b.capacity();
double v;
for (int i = 0; i < n; i++)
b.rewind();
}
int n = b.remaining();
double v;
for (int i = start; i < n; i++)
b.rewind();
}
int n = b.capacity();
double v;
for (int i = 0; i < n; i++)
b.rewind();
}
int n = b.capacity();
double[] a = new double[n + 7];
b.get(a, 7, n);
for (int i = 0; i < n; i++)
}
int n = b.capacity();
b.clear();
for (int i = 0; i < n; i++)
b.flip();
}
int n = b.capacity();
b.clear();
for (int i = 0; i < n; i++)
b.limit(n);
b.position(0);
}
int n = b.capacity();
b.clear();
double[] a = new double[n + 7];
for (int i = 0; i < n; i++)
a[i + 7] = (double)ic(i);
b.put(a, 7, n);
b.flip();
}
int n = b.capacity();
b.clear();
c.position(7);
for (int i = 0; i < n; i++)
c.flip();
c.position(7);
b.put(c);
b.flip();
}
//6231529
b.position(0);
b.mark();
b.asReadOnlyBuffer().reset();
}
// 6221101-6234263
private static void putBuffer() {
final int cap = 10;
}
}
double x, double y) {
}
boolean caught = false;
try {
} catch (Throwable x) {
caught = true;
} else {
}
}
if (!caught)
}
}
fail("Wrong direction", b);
// Gets and puts
relPut(b);
relGet(b);
absGet(b);
bulkGet(b);
absPut(b);
relGet(b);
absGet(b);
bulkGet(b);
bulkPutArray(b);
relGet(b);
bulkPutBuffer(b);
relGet(b);
// Compact
relPut(b);
b.position(13);
b.compact();
b.flip();
relGet(b, 13);
// Exceptions
relPut(b);
public void run() {
b.get();
}});
public void run() {
b.put((double)42);
}});
// The index must be non-negative and lesss than the buffer's limit.
public void run() {
}});
public void run() {
b.get(-1);
}});
public void run() {
}});
public void run() {
b.position(0);
b.mark();
b.compact();
b.reset();
}});
// Values
b.clear();
b.put((double)0);
b.put((double)-1);
b.put((double)1);
double v;
b.flip();
// Comparison
b.rewind();
b.position(2);
for (int i = 2; i < b.limit(); i++) {
double x = b.get(i);
if (x != y
)
}
}
b.put((double)99);
b.rewind();
// Check equals and compareTo with interesting values
for (double x : VALUES) {
}
}
for (double y : VALUES) {
fail("compareTo not anti-symmetric",
}
fail("compareTo inconsistent with equals",
}
if (x == 0.0 && y == 0.0) continue;
fail("Incorrect results for DoubleBuffer.compareTo",
}
fail("Incorrect results for DoubleBuffer.equals",
}
}
}
// Sub, dup
relPut(b);
b.position(13);
// Slice
b.position(5);
checkSlice(b, sb);
b.position(0);
fail("Array offsets do not match: "
// Read-only views
b.rewind();
public void run() {
}});
public void run() {
}});
public void run() {
}});
public void run() {
}});
public void run() {
}});
public void run() {
}});
public void run() {
rb.arrayOffset();
}});
fail("Read-only heap buffer's backing array is accessible",
rb);
}
// Bulk puts from read-only buffers
b.clear();
relPut(b); // Required by testViews
}
int offset = 47;
int length = 900;
show(0, b);
// The offset must be non-negative and no larger than <array.length>.
public void run() {
}});
public void run() {
}});
public void run() {
}});
public void run() {
}});
// A NullPointerException will be thrown if the array is null.
public void run() {
}});
public void run() {
}});
}
private static void testAllocate() {
// An IllegalArgumentException will be thrown for negative capacities.
public void run() {
}});
}
public static void test() {
testAllocate();
test(new double[1024]);
putBuffer();
}
}