decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
text for 0047.24 pdf | 96 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
text for 0047.24 pdf
Authored by: capt.Hij on Saturday, May 19 2012 @ 03:10 PM EDT
G:gingerbread23 - GOOGLE-00-00000527ctstoolsdx-
testssrcdxcjunitopcodesn
newarrayTest_newarray.java
1 /*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the
"License");
5 * you may not use this file except in compliance with
the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in
writing, software
11 * distributed under the License is distributed on an
"AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.
13 * See the License for the specific language governing
permissions and
14 * limitations under the License.
15 */
16
17 package dxc.junit.opcodes.newarray;
18
19 import dxc.junit.DxTestCase;
20 import dxc.junit.DxUtil;
21 import dxc.junit.opcodes.newarray.jm.T_newarray_1;
22 import dxc.junit.opcodes.newarray.jm.T_newarray_2;
23
24 public class Test_newarray extends DxTestCase {
25
26 /*
27 * @title Array of ints
28 */
29 public void testN1() {
30 T_newarray_1 t = new T_newarray_1();
31 int[] r = t.run(10);
32 int l = r.length;
33 assertEquals(10, l);
34
35 // check default initialization
36 for (int i = 0; i < l; i++) {
37 assertEquals(0, r[i]);
38 }
39
40 }
41
42 /**
43 * @title Array of floats
44 */
45 public void testN2() {
46 T_newarray_2 t = new T_newarray_2();
47 float[] r = t.run(10);
48 int l = r.length;
49 assertEquals(10, l);
50
51 // check default initialization
52 for (int i = 0; i < l; i++) {
53 assertEquals(0f, r[i]);
55
54 }
55 }
56
57 /**
58 * @title expected NegativeArraySizeException
59 */

UNITED STATES DISTRICT COURT
NORTHERN DISTRICT OF CALIFORNIA
TRIAL EXHIBIT47.24
CASE NO. 10-03561 WHA
DATE ENTERED
BY
DEPUTY CLERK

Page 1 of 3


G:gingerbread23 - GOOGLE-00-00000527ctstoolsdx-
testssrcdxcjunitopcodesn
newarrayTest_newarray.java
60 public void testE1() {
61 T_newarray_2 t = new T_newarray_2();
62 try {
63 t.run(-1);
64 fail("expected NegativeArraySizeException");
65 } catch (NegativeArraySizeException nase) {
66 // expected
67 }
68 }
69
70 /**
71 * @title Array size = 0
72 */
73 public void testB1() {
74 T_newarray_1 t = new T_newarray_1();
75 int[] r = t.run(0);
76 assertNotNull(r);
77 assertEquals(0, r.length);
78 }
79
80 /**
81 * @constraint 4.8.2.1
82 * @title number of arguments
83 */
84 public void testVFE1() {
85 try {
86
Class.forName("dxc.junit.opcodes.newarray.jm.T_newarray_3");
87 fail("expected a verification exception");
88 } catch (Throwable t) {
89 DxUtil.checkVerifyException(t);
90 }
91 }
92
93 /**
94 * @constraint 4.8.2.1
95 * @title type of argument - float
96 */
97 public void testVFE2() {
98 try {
99
Class.forName("dxc.junit.opcodes.newarray.jm.T_newarray_4");
100 fail("expected a verification exception");
101 } catch (Throwable t) {
102 DxUtil.checkVerifyException(t);
103 }
104 }
105
106 /**
107 * @constraint 4.8.2.20
108 * @title atype must take one of the following
109 * values
110 */
111 public void testVFE3() {
112 try {
113
Class.forName("dxc.junit.opcodes.newarray.jm.T_newarray_5");
114 fail("expected a verification exception");
115 } catch (Throwable t) {
116 DxUtil.checkVerifyException(t);
117 }
118 }
119
Page 2 of 3

G:gingerbread23 - GOOGLE-00-00000527ctstoolsdx-
testssrcdxcjunitopcodesn
newarrayTest_newarray.java
120 /**
121 * @constraint 4.8.2.1
122 * @title type of argument - reference
123 */
124 public void testVFE4() {
125 try {
126
Class.forName("dxc.junit.opcodes.newarray.jm.T_newarray_6");
127 fail("expected a verification exception");
128 } catch (Throwable t) {
129 DxUtil.checkVerifyException(t);
130 }
131 }
132
133 }

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )