From: <bi...@us...> - 2008-09-24 22:37:10
|
Revision: 3392 http://oorexx.svn.sourceforge.net/oorexx/?rev=3392&view=rev Author: bigrixx Date: 2008-09-24 22:36:57 +0000 (Wed, 24 Sep 2008) Log Message: ----------- [ 2126996 ] Allow dynamic creation of external methods and routines. Modified Paths: -------------- test/trunk/ooRexx/base/class/Method.testGroup test/trunk/ooRexx/base/class/Routine.testGroup Modified: test/trunk/ooRexx/base/class/Method.testGroup =================================================================== --- test/trunk/ooRexx/base/class/Method.testGroup 2008-09-24 22:35:44 UTC (rev 3391) +++ test/trunk/ooRexx/base/class/Method.testGroup 2008-09-24 22:36:57 UTC (rev 3392) @@ -115,7 +115,45 @@ method~setProtected self~assertTrue(method~isProtected) +::method TestLoadExternalMethod01 + method = .method~loadExternalMethod("INIT", "LIBRARY rxregexp RegExp_Init") + self~assertTrue(method~isA(.method)) + method = .method~loadExternalMethod("RegExp_Init", "LIBRARY rxregexp") + self~assertTrue(method~isA(.method)) + + method = .method~loadExternalMethod("Init", "LIBRARY rxregexp not_one_we_have") + self~assertSame(.nil, method) + + method = .method~loadExternalMethod("Init", "LIBRARY not_one_we_have") + self~assertSame(.nil, method) + +::method TestLoadExternalMethod02 + self~expectSyntax('88.901') + .method~loadExternalMethod + +::method TestLoadExternalMethod03 + self~expectSyntax('88.901') + .method~loadExternalMethod("FOO") + +::method TestLoadExternalMethod04 + self~expectSyntax('93.902') + .method~loadExternalMethod("FOO", "Bar", "And Then Some") + +::method TestLoadExternalMethod05 + self~expectSyntax('88.901') + .method~loadExternalMethod(,"FOO") + +::method TestLoadExternalMethod06 + self~expectSyntax('99.917') + .method~loadExternalMethod("FOO","PACKAGE rxmath RxCalcSqrt") + +::method TestLoadExternalMethod07 + self~expectSyntax('99.917') + .method~loadExternalMethod("FOO","LIBRARY") + + + ::class RunTester ::method setMethod forward class(super) Modified: test/trunk/ooRexx/base/class/Routine.testGroup =================================================================== --- test/trunk/ooRexx/base/class/Routine.testGroup 2008-09-24 22:35:44 UTC (rev 3391) +++ test/trunk/ooRexx/base/class/Routine.testGroup 2008-09-24 22:36:57 UTC (rev 3392) @@ -137,3 +137,46 @@ args[3] = "Mike" a = routine~callWith(args) self~assertEquals(args, a) + +::method TestLoadExternalRoutine01 + routine = .routine~loadExternalRoutine("SQRT", "LIBRARY rxmath RxCalcSqrt") + self~assertTrue(routine~isA(.routine)) + self~assertSame(2, routine~call(4)) + + routine = .routine~loadExternalRoutine("RxCalcSqrt", "LIBRARY rxmath") + self~assertTrue(routine~isA(.routine)) + self~assertSame(2, routine~call(4)) + + routine = .routine~loadExternalRoutine("RxCalcSqrt", "LIBRARY rxmath not_one_we_have") + self~assertSame(.nil, routine) + + routine = .routine~loadExternalRoutine("RxCalcSqrt", "LIBRARY not_one_we_have") + self~assertSame(.nil, routine) + +::method TestLoadExternalRoutine02 + self~expectSyntax('88.901') + .routine~loadExternalRoutine + +::method TestLoadExternalRoutine03 + self~expectSyntax('88.901') + .routine~loadExternalRoutine("FOO") + +::method TestLoadExternalRoutine04 + self~expectSyntax('93.902') + .routine~loadExternalRoutine("FOO", "Bar", "And Then Some") + +::method TestLoadExternalRoutine05 + self~expectSyntax('88.901') + .routine~loadExternalRoutine(,"FOO") + +::method TestLoadExternalRoutine06 + self~expectSyntax('99.917') + .routine~loadExternalRoutine("FOO","PACKAGE rxmath RxCalcSqrt") + +::method TestLoadExternalRoutine07 + self~expectSyntax('99.917') + .routine~loadExternalRoutine("FOO","LIBRARY") + +::method TestLoadExternalRoutine08 + self~expectSyntax('99.917') + .routine~loadExternalRoutine("FOO","PACKAGE rxmath RxCalcSqrt AndExtra") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |