Skip to content

Commit c3c80cd

Browse files
committed
Removing nextAction debug track. #18
1 parent 7dd9a4e commit c3c80cd

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

lib/src/internal/debug_listener.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ abstract class DebugListener {
55

66
void onScheduleNextAction();
77

8-
void onNextAction();
9-
108
void onExecuteAction();
119

1210
void onStop();

lib/src/resources.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:collection';
33
import 'package:meta/meta.dart';
44
import 'package:simdart/src/event_phase.dart';
55
import 'package:simdart/src/internal/completer_action.dart';
6-
import 'package:simdart/src/internal/completer_interrupt.dart';
76
import 'package:simdart/src/internal/event_action.dart';
87
import 'package:simdart/src/simdart.dart';
98

lib/src/simdart.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ class SimDart implements SimDartInterface {
149149
void stop() {
150150
print("stop");
151151
_addAction(StopAction(start: now, sim:this));
152-
_scheduleNextAction();
153152
}
154153

155-
void _disposeCompleteList() {
154+
void _disposeCompleterList() {
156155
while (_completerList.isNotEmpty) {
157156
Completer<void> completer = _completerList.removeAt(0);
158157
_debugListener?.onRemoveCompleter();
@@ -258,11 +257,9 @@ class SimDart implements SimDartInterface {
258257
}
259258

260259
Future<void> _nextAction() async {
261-
print('_nextAction');
262-
_debugListener?.onNextAction();
263260
_nextActionScheduled = false;
264261
if (_actions.isEmpty || runState!=RunState.running) {
265-
_disposeCompleteList();
262+
_disposeCompleterList();
266263
if(!_terminator.isCompleted) {
267264
_terminator.complete();
268265
}

test/stop_test.dart

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ void main() {
3232
helper.testEvents(['[0][a][called]', '[0][a][finished]']);
3333
helper.testTracks([
3434
'scheduleNextAction',
35-
'nextAction',
3635
'executeAction',
3736
'scheduleNextAction',
38-
'nextAction',
3937
'executeAction',
4038
'stop',
41-
'scheduleNextAction',
42-
'nextAction'
39+
'scheduleNextAction'
4340
]);
4441
expect(helper.completerCount, 0);
4542
});
@@ -70,17 +67,13 @@ void main() {
7067
]);
7168
helper.testTracks([
7269
'scheduleNextAction',
73-
'nextAction',
7470
'executeAction',
7571
'scheduleNextAction',
76-
'nextAction',
7772
'executeAction',
7873
'scheduleNextAction',
79-
'nextAction',
8074
'executeAction',
8175
'stop',
82-
'scheduleNextAction',
83-
'nextAction'
76+
'scheduleNextAction'
8477
]);
8578
print("counter valor:${sim.counter('counter').value} ");
8679
expect(sim.counter('counter').value, 1);
@@ -126,20 +119,15 @@ void main() {
126119
]);
127120
helper.testTracks([
128121
'scheduleNextAction',
129-
'nextAction',
130122
'executeAction',
131123
'scheduleNextAction',
132-
'nextAction',
133124
'executeAction',
134125
'scheduleNextAction',
135-
'nextAction',
136126
'executeAction',
137127
'scheduleNextAction',
138-
'nextAction',
139128
'executeAction',
140129
'stop',
141-
'scheduleNextAction',
142-
'nextAction'
130+
'scheduleNextAction'
143131
]);
144132
expect(sim.counter('counter1').value, 1);
145133
expect(sim.counter('counter2').value, 1);

0 commit comments

Comments
 (0)