diff --git a/scripts/TestRunner.js b/scripts/TestRunner.js index 335f04a..4986b00 100644 --- a/scripts/TestRunner.js +++ b/scripts/TestRunner.js @@ -93,7 +93,7 @@ rectest.TestRunner = Class( 'TestRunner', var _self = this, run = this._setFactory.fromId( options.ralgo, - test_case, options + test_case.getSet( options.set ), options ); // allow test case to initialize its display diff --git a/scripts/set/RandomGroupedSet.js b/scripts/set/RandomGroupedSet.js index 0db21cc..222f712 100644 --- a/scripts/set/RandomGroupedSet.js +++ b/scripts/set/RandomGroupedSet.js @@ -7,12 +7,6 @@ rectest.set.RandomGroupedSet = Class( 'RandomGroupedSet' ) .implement( rectest.set.Set ) .extend( { - /** - * Test case being executed - * @var {TestCase} - */ - 'private _case': null, - /** * Number of samples remaining * @var {number} @@ -38,10 +32,9 @@ rectest.set.RandomGroupedSet = Class( 'RandomGroupedSet' ) 'private _setPos': 0, - __construct: function( test_case, options ) + __construct: function( base_set, options ) { - this._case = test_case; - this._set = test_case.getSet( options.set ); + this._set = base_set; this._setLength = this._set.length; this._samplesRemain = +options.samples || -1; diff --git a/scripts/set/Set.js b/scripts/set/Set.js index 5e7780d..454b168 100644 --- a/scripts/set/Set.js +++ b/scripts/set/Set.js @@ -3,7 +3,13 @@ */ rectest.set.Set = Interface( 'Set', { - __construct: [ 'test_case', 'options' ], + /** + * Create a new set from a base set and the given options + * + * @param {Array.} base_set base set + * @param {Object} options configuration options + */ + __construct: [ 'base_set', 'options' ], /** diff --git a/scripts/set/SetFactory.js b/scripts/set/SetFactory.js index cf2f9d1..cf382e4 100644 --- a/scripts/set/SetFactory.js +++ b/scripts/set/SetFactory.js @@ -3,20 +3,15 @@ */ rectest.set.SetFactory = Class( 'SetFactory', { - 'public fromId': function( id, test_case, options ) + 'public fromId': function( id, base_set, options ) { var sets = rectest.set; - if ( !( Class.isA( rectest.TestCase, test_case ) ) ) - { - throw TypeError( "Invalid test case: " + test_case ); - } - return [ null, sets.RandomGroupedSet, null, null - ][ id ]( test_case, options ); + ][ id ]( base_set, options ); } } );