equal
deleted
inserted
replaced
143 } |
143 } |
144 |
144 |
145 static void testAccess(Object base, long offset) { |
145 static void testAccess(Object base, long offset) { |
146 // Plain |
146 // Plain |
147 { |
147 { |
148 UNSAFE.putChar(base, offset, 'a'); |
148 UNSAFE.putChar(base, offset, '\u0123'); |
149 char x = UNSAFE.getChar(base, offset); |
149 char x = UNSAFE.getChar(base, offset); |
150 assertEquals(x, 'a', "set char value"); |
150 assertEquals(x, '\u0123', "set char value"); |
151 } |
151 } |
152 |
152 |
153 // Volatile |
153 // Volatile |
154 { |
154 { |
155 UNSAFE.putCharVolatile(base, offset, 'b'); |
155 UNSAFE.putCharVolatile(base, offset, '\u4567'); |
156 char x = UNSAFE.getCharVolatile(base, offset); |
156 char x = UNSAFE.getCharVolatile(base, offset); |
157 assertEquals(x, 'b', "putVolatile char value"); |
157 assertEquals(x, '\u4567', "putVolatile char value"); |
158 } |
158 } |
159 |
159 |
160 |
160 |
161 |
161 |
162 |
162 |
164 } |
164 } |
165 |
165 |
166 static void testAccess(long address) { |
166 static void testAccess(long address) { |
167 // Plain |
167 // Plain |
168 { |
168 { |
169 UNSAFE.putChar(address, 'a'); |
169 UNSAFE.putChar(address, '\u0123'); |
170 char x = UNSAFE.getChar(address); |
170 char x = UNSAFE.getChar(address); |
171 assertEquals(x, 'a', "set char value"); |
171 assertEquals(x, '\u0123', "set char value"); |
172 } |
172 } |
173 } |
173 } |
174 } |
174 } |
175 |
175 |