|
@@ -65,8 +65,37 @@ class Issue4130 extends Test
|
|
|
var weak2Ptr = new haxe.ds.WeakMap<TestKey, cpp.Pointer<Int> >();
|
|
|
weak2Ptr.set( key, valPtr );
|
|
|
eq( weak2Ptr.get(key), valPtr );
|
|
|
+
|
|
|
+ // Functions
|
|
|
+ var valFunc = cpp.Callable.fromStaticFunction( someFunc );
|
|
|
+
|
|
|
+ var int2Func = new haxe.ds.IntMap< cpp.Callable<Int->Int> >();
|
|
|
+ int2Func.set( 42, valFunc );
|
|
|
+ var key:Dynamic = 42;
|
|
|
+ int2Func.set( key, valFunc );
|
|
|
+ eq( int2Func.get(42), valFunc);
|
|
|
+ eq( int2Func.get(key), valFunc);
|
|
|
+
|
|
|
+ var string2Func = new haxe.ds.StringMap< cpp.Callable<Int->Int> >();
|
|
|
+ string2Func.set( "42", valFunc );
|
|
|
+ var key:Dynamic = "42";
|
|
|
+ string2Func.set( key, valFunc );
|
|
|
+ eq( string2Func.get("42"), valFunc );
|
|
|
+ eq( string2Func.get(key), valFunc );
|
|
|
+
|
|
|
+ var key = new TestKey();
|
|
|
+ var obj2Func = new haxe.ds.ObjectMap<TestKey, cpp.Callable<Int->Int> >();
|
|
|
+ obj2Func.set( key, valFunc );
|
|
|
+ eq( obj2Func.get(key), valFunc );
|
|
|
+
|
|
|
+ var weak2Func = new haxe.ds.WeakMap<TestKey, cpp.Callable<Int->Int> >();
|
|
|
+ weak2Func.set( key, valFunc );
|
|
|
+ eq( weak2Func.get(key), valFunc );
|
|
|
+
|
|
|
#end
|
|
|
}
|
|
|
+
|
|
|
+ static function someFunc(a:Int) : Int return a;
|
|
|
#end
|
|
|
}
|
|
|
|