Skip to content

Commit 0806012

Browse files
committed
Fix test typing
1 parent 0662b64 commit 0806012

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

contrib/platform/src/com/sun/jna/platform/mac/IOKit.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public interface IOKit extends Library {
5454

5555
MachPort MACH_PORT_NULL = new MachPort();
5656

57-
58-
5957
/**
6058
* IOKitLib implements non-kernel task access to common IOKit object types -
6159
* IORegistryEntry, IOService, IOIterator etc. These functions are generic -
@@ -322,8 +320,7 @@ CFTypeRef IORegistryEntryCreateCFProperty(IORegistryEntry entry, CFStringRef key
322320
* @return 0 if successful, otherwise a {@code kern_return_t} error code.
323321
*/
324322
int IORegistryEntryCreateCFProperties(IORegistryEntry entry, PointerByReference properties,
325-
CFAllocatorRef allocator,
326-
int options);
323+
CFAllocatorRef allocator, int options);
327324

328325
/**
329326
* Create a CF representation of a registry entry's property.
@@ -348,8 +345,7 @@ int IORegistryEntryCreateCFProperties(IORegistryEntry entry, PointerByReference
348345
* caller should release with CFRelease.
349346
*/
350347
CFTypeRef IORegistryEntrySearchCFProperty(IORegistryEntry entry, String plane, CFStringRef key,
351-
CFAllocatorRef allocator,
352-
int options);
348+
CFAllocatorRef allocator, int options);
353349

354350
/**
355351
* Returns an ID for the registry entry that is global to all tasks.

contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class CoreFoundationTest {
6161
public void testCFStringRef() {
6262
String awesome = "ǝɯosǝʍɐ sı ∀Nſ"; // Unicode
6363
CFStringRef cfAwesome = CFStringRef.createCFString(awesome);
64-
assertEquals(awesome.length(), CF.CFStringGetLength(cfAwesome));
64+
assertEquals(awesome.length(), CF.CFStringGetLength(cfAwesome).intValue());
6565
assertEquals(awesome, cfAwesome.stringValue());
6666

6767
Memory mem = new Memory(awesome.getBytes().length + 1);
@@ -105,13 +105,13 @@ public void testCFRetainCount() {
105105
DoubleByReference e = new DoubleByReference(Math.E);
106106
CFNumberRef cfE = CF.CFNumberCreate(null, CFNumberType.kCFNumberDoubleType.typeIndex(), e);
107107
CFNumberRef cfPi = CF.CFNumberCreate(null, CFNumberType.kCFNumberDoubleType.typeIndex(), pi);
108-
assertEquals(1, CF.CFGetRetainCount(cfE));
109-
assertEquals(1, CF.CFGetRetainCount(cfPi));
108+
assertEquals(1, CF.CFGetRetainCount(cfE).intValue());
109+
assertEquals(1, CF.CFGetRetainCount(cfPi).intValue());
110110
cfE.retain();
111111
cfPi.retain();
112112
cfPi.retain();
113-
assertEquals(2, CF.CFGetRetainCount(cfE));
114-
assertEquals(3, CF.CFGetRetainCount(cfPi));
113+
assertEquals(2, CF.CFGetRetainCount(cfE).intValue());
114+
assertEquals(3, CF.CFGetRetainCount(cfPi).intValue());
115115

116116
List<CFTypeRef> irrationalReferences = new ArrayList<>();
117117
irrationalReferences.add(cfE);
@@ -120,10 +120,10 @@ public void testCFRetainCount() {
120120
value.release();
121121
}
122122

123-
assertEquals(1, CF.CFGetRetainCount(cfE));
124-
assertEquals(2, CF.CFGetRetainCount(cfPi));
123+
assertEquals(1, CF.CFGetRetainCount(cfE).intValue());
124+
assertEquals(2, CF.CFGetRetainCount(cfPi).intValue());
125125
cfPi.release();
126-
assertEquals(1, CF.CFGetRetainCount(cfPi));
126+
assertEquals(1, CF.CFGetRetainCount(cfPi).intValue());
127127
cfE.release();
128128
cfPi.release();
129129
}
@@ -140,7 +140,7 @@ public void testCFArray() {
140140
}
141141
CFArrayRef cfPtrArray = CF.CFArrayCreate(null, contiguousArray, new CFIndex(refArray.length), null);
142142

143-
assertEquals(refArray.length, CF.CFArrayGetCount(cfPtrArray));
143+
assertEquals(refArray.length, CF.CFArrayGetCount(cfPtrArray).intValue());
144144
for (int i = 0; i < refArray.length; i++) {
145145
Pointer result = CF.CFArrayGetValueAtIndex(cfPtrArray, new CFIndex(i));
146146
CFNumberRef numRef = new CFNumberRef(result);

contrib/platform/test/com/sun/jna/platform/mac/IOKitTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public void testIteratorParentChild() {
147147
// Iterate over USB Controllers. All devices are children of one of
148148
// these controllers in the "IOService" plane
149149
IOIterator iter = IOKitUtil.getMatchingServices("IOUSBController");
150+
assertNotNull(iter);
150151
IORegistryEntry controllerDevice = iter.next();
151152
while (controllerDevice != null) {
152153
LongByReference id = new LongByReference();

0 commit comments

Comments
 (0)