From 3575a0e59b148e279ba19b607d4df00b52d589e5 Mon Sep 17 00:00:00 2001 From: Leonid Shalupov Date: Sat, 7 May 2022 18:54:54 +0200 Subject: [PATCH] more assertions for CFDictionaryRef.ByReference and CFStringRef.ByReference fixes after review #1433 --- .../test/com/sun/jna/platform/mac/CoreFoundationTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java b/contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java index a046717a57..0a83c796e1 100644 --- a/contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java +++ b/contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java @@ -271,6 +271,9 @@ public void testCFStringRefByReference() { // test constructor(null) assertNull(new CFStringRef.ByReference(null).getValue()); + // test constructor(CFStringRef) + assertTrue(CF.CFEqual(new CFStringRef.ByReference(key).getStringRefValue(), key)); + // test setValue(null) assertNotNull(byRef.getStringRefValue()); byRef.setValue(null); @@ -315,6 +318,9 @@ public void testCFDictionaryRefByReference() { // test constructor(null) assertNull(new CFDictionaryRef.ByReference(null).getValue()); + // test constructor(CFDictionaryRef) + assertTrue(CF.CFEqual(new CFDictionaryRef.ByReference(dict).getDictionaryRefValue(), dict)); + // test setValue(null) assertNotNull(byRef.getDictionaryRefValue()); byRef.setValue(null);