Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT READY : Fix tests ( let's discuss ) #24

Merged
merged 2 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion proto/wtools/abase/l8.test/Event.test.s
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ function onWithArguments( test )
}
}

onWithArguments.timeOut = 30000;

// function onWithArguments( test )
// {
// var self = this;
Expand Down Expand Up @@ -514,7 +516,7 @@ function onWithOptionsMap( test )
}
}

onWithOptionsMap.timeOut = 10000;
onWithOptionsMap.timeOut = 30000;

// //
//
Expand Down
88 changes: 44 additions & 44 deletions proto/wtools/abase/l8.test/Time.test.s
Original file line number Diff line number Diff line change
Expand Up @@ -2549,50 +2549,50 @@ function beginWithProcedure( test )
});
});

// qqq for Dmytro
// ready.then( () =>
// {
// test.case = 'executes method cancel twice, should throw error';
// var timer = _.time.begin( Infinity, onTime, onCancel );
// timer.cancel();
//
// return _.time.out( context.t1, () => timer.cancel() )
// .finally( ( err, arg ) =>
// {
// if( arg )
// {
// test.true( false );
// }
// else
// {
// _.errAttend( err );
// test.true( true );
// }
// return null;
// });
// });
//
// ready.then( () =>
// {
// test.case = 'executes method time and then method cancel, should throw error';
// var timer = _.time.begin( Infinity, onTime, onCancel );
// timer.time();
//
// return _.time.out( context.t1, () => timer.cancel() )
// .finally( ( err, arg ) =>
// {
// if( arg )
// {
// test.true( false );
// }
// else
// {
// _.errAttend( err );
// test.true( true );
// }
// return null;
// });
// });
/* qqq for Dmytro */ /* Dmytro : fixed */
ready.then( () =>
{
test.case = 'executes method cancel twice, should throw error';
var timer = _.time.begin( Infinity, onTime, onCancel );
timer.cancel();

return _.time.out( context.t1, () => timer.cancel() )
.finally( ( err, arg ) =>
{
if( arg )
{
test.true( false );
}
else
{
_.errAttend( err );
test.true( true );
}
return null;
});
});

ready.then( () =>
{
test.case = 'executes method time and then method cancel, should throw error';
var timer = _.time.begin( Infinity, onTime, onCancel );
timer.time();

return _.time.out( context.t1, () => timer.cancel() )
.finally( ( err, arg ) =>
{
if( arg )
{
test.true( false );
}
else
{
_.errAttend( err );
test.true( true );
}
return null;
});
});

ready.then( () =>
{
Expand Down
9 changes: 4 additions & 5 deletions proto/wtools/abase/l8_procedure/Namespace.s
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,10 @@ function _timeBegin( o )
function cancel()
{

/* xxx qqq for Dmytro : look suspicious! */
if( timer.state !== 0 && o.method.name !== '_periodic' )
{
return;
}
/* xxx aaa for Dmytro : look suspicious! */ /* Dmytro : add conditions to fix behavior of routine */
// if( timer.state !== 0 && o.method.name !== '_periodic' )
if( timer.state !== 0 && timer.state !== -2 && timer.state !== 2 && o.method.name !== '_periodic' )
return;

if( !o.procedure.use() && !o.procedure.isTopMost() )
o.procedure.activate( true );
Expand Down