@@ -8,21 +8,22 @@ Class {
88 #category : #' Sindarin-Tests'
99}
1010
11- { #category : #tests }
11+ { #category : #helpers }
1212SindarinDebuggerTests >> helperMethod1 [
1313 | a |
14+ a := 1 .
1415 a := 5 .
1516 ^ Point x: 5 y: ' 3' asInteger.
1617]
1718
18- { #category : #tests }
19+ { #category : #helpers }
1920SindarinDebuggerTests >> helperMethod10 [
2021 | a |
2122 a := 5 .
2223 ^ Point x: 5 y: ' 3' asInteger.
2324]
2425
25- { #category : #tests }
26+ { #category : #helpers }
2627SindarinDebuggerTests >> helperMethod11 [
2728 | a |
2829 a := 5 .
@@ -31,145 +32,145 @@ SindarinDebuggerTests >> helperMethod11 [
3132 ^ 3
3233]
3334
34- { #category : #tests }
35+ { #category : #helpers }
3536SindarinDebuggerTests >> helperMethod12 [
3637 | i |
3738 i := 5 .
3839 [ i= 0 ] whileFalse: [ i := i - 1 ].
3940]
4041
41- { #category : #tests }
42+ { #category : #helpers }
4243SindarinDebuggerTests >> helperMethod13 [
4344 | a |
4445 a := 5 .
4546 ^ Point x: 5 y: ' 3' asInteger.
4647]
4748
48- { #category : #tests }
49+ { #category : #helpers }
4950SindarinDebuggerTests >> helperMethod14 [
5051 | a |
5152 a := 5 .
5253 ^ Point x: 5 y: ' 3' asInteger.
5354]
5455
55- { #category : #tests }
56+ { #category : #helpers }
5657SindarinDebuggerTests >> helperMethod15 [
5758 | a |
5859 a := 5 .
5960 ^ Point x: 5 y: ' 3' asInteger.
6061]
6162
62- { #category : #tests }
63+ { #category : #helpers }
6364SindarinDebuggerTests >> helperMethod16 [
6465 ^ 1 + 1 .
6566]
6667
67- { #category : #tests }
68+ { #category : #helpers }
6869SindarinDebuggerTests >> helperMethod17: storeContextBlock [
6970 storeContextBlock value: thisContext.
7071 Point x: 5 y: 7 .
7172]
7273
73- { #category : #tests }
74+ { #category : #helpers }
7475SindarinDebuggerTests >> helperMethod18: anArg with: anotherArg [
7576 Point x: 5 y: 7 .
7677]
7778
78- { #category : #tests }
79+ { #category : #helpers }
7980SindarinDebuggerTests >> helperMethod19 [
8081 | a |
8182 a := 5 .
8283 ^ Point x: 5 y: ' 3' asInteger.
8384]
8485
85- { #category : #tests }
86+ { #category : #helpers }
8687SindarinDebuggerTests >> helperMethod2 [
8788 | a |
8889 a := 5 .
8990 ^ Point x: 5 y: ' 3' asInteger.
9091]
9192
92- { #category : #tests }
93+ { #category : #helpers }
9394SindarinDebuggerTests >> helperMethod20 [
9495 | a |
9596 a := 5 .
9697 ^ Point x: 5 y: ' 3' asInteger.
9798]
9899
99- { #category : #tests }
100+ { #category : #helpers }
100101SindarinDebuggerTests >> helperMethod21 [
101102 self helperMethod22
102103]
103104
104- { #category : #tests }
105+ { #category : #helpers }
105106SindarinDebuggerTests >> helperMethod22 [
106107 ^ Point new
107108]
108109
109- { #category : #tests }
110+ { #category : #helpers }
110111SindarinDebuggerTests >> helperMethod23 [
111112 testObjectPoint sign.
112113 testObjectPoint extent: (Point x: 3 y: 4 ).
113114 Point new .
114115]
115116
116- { #category : #tests }
117+ { #category : #helpers }
117118SindarinDebuggerTests >> helperMethod24 [
118119 | p |
119120 p := Point new .
120121 p sign.
121122]
122123
123- { #category : #tests }
124+ { #category : #helpers }
124125SindarinDebuggerTests >> helperMethod3 [
125126 | a |
126127 a := 5 .
127128 ^ Point x: 5 y: ' 3' asInteger.
128129]
129130
130- { #category : #tests }
131+ { #category : #helpers }
131132SindarinDebuggerTests >> helperMethod4 [
132133 | a |
133134 a := 5 .
134135 ^ Point x: 5 y: ' 3' asInteger.
135136]
136137
137- { #category : #tests }
138+ { #category : #helpers }
138139SindarinDebuggerTests >> helperMethod5 [
139140 | a |
140141 a := 5 .
141142 ^ Point x: 5 y: ' 3' asInteger.
142143]
143144
144- { #category : #tests }
145+ { #category : #helpers }
145146SindarinDebuggerTests >> helperMethod6 [
146147 | a |
147148 a := 5 .
148149 ^ Point x: 5 y: ' 3' asInteger.
149150]
150151
151- { #category : #tests }
152+ { #category : #helpers }
152153SindarinDebuggerTests >> helperMethod7 [
153154 | a |
154155 a := 5 .
155156 ^ Point x: 5 y: ' 3' asInteger.
156157]
157158
158- { #category : #tests }
159+ { #category : #helpers }
159160SindarinDebuggerTests >> helperMethod8 [
160161 | a |
161162 a := 5 .
162163 ^ Point x: 5 y: ' 3' asInteger.
163164]
164165
165- { #category : #tests }
166+ { #category : #helpers }
166167SindarinDebuggerTests >> helperMethod9 [
167168 | a |
168169 a := 5 .
169170 ^ Point x: 5 y: ' 3' asInteger.
170171]
171172
172- { #category : #tests }
173+ { #category : #running }
173174SindarinDebuggerTests >> runCaseManaged [
174175 ^ self runCase
175176]
@@ -399,6 +400,17 @@ SindarinDebuggerTests >> testOnceBreakpoint [
399400 self assert: scdbg isExecutionFinished
400401]
401402
403+ { #category : #tests }
404+ SindarinDebuggerTests >> testPc [
405+ | dbg |
406+ dbg := SindarinDebugger
407+ debug: [ | a p |
408+ a := 2 .
409+ p := Point x: 2 y: 3 ].
410+ dbg step; step; step.
411+ self assert: dbg pc equals: dbg context pc
412+ ]
413+
402414{ #category : #tests }
403415SindarinDebuggerTests >> testReceiver [
404416 | scdbg |
@@ -455,6 +467,28 @@ SindarinDebuggerTests >> testSkip [
455467 self assert: p equals: nil
456468]
457469
470+ { #category : #tests }
471+ SindarinDebuggerTests >> testSkipToPC [
472+ | dbg realExecPC realValueOfA realExecNode realExecTopStack |
473+ dbg := SindarinDebugger
474+ debug: [ self helperMethod1 ].
475+ dbg step; stepOver; stepOver.
476+ realExecPC := dbg pc.
477+ realExecNode := dbg node.
478+ realValueOfA := (dbg temporaryNamed: #a ).
479+ realExecTopStack := dbg topStack.
480+
481+ dbg := SindarinDebugger
482+ debug: [ self helperMethod1 ].
483+
484+ dbg step; stepOver; skipToPC: realExecPC.
485+ self assert: dbg pc equals: realExecPC.
486+ self assert: dbg node equals: realExecNode.
487+ self assert: realValueOfA equals: 5 .
488+ self assert: (dbg temporaryNamed: #a ) equals: 1 .
489+ self assert: dbg topStack equals: realExecTopStack
490+ ]
491+
458492{ #category : #tests }
459493SindarinDebuggerTests >> testSkipWith [
460494 | a p scdbg |
@@ -558,6 +592,26 @@ SindarinDebuggerTests >> testTemporaries [
558592 self assert: (scdbg temporaries at: #a ) equals: 5
559593]
560594
595+ { #category : #tests }
596+ SindarinDebuggerTests >> testTemporaryNamed [
597+ | dbg |
598+ dbg := SindarinDebugger debug: [ self helperMethod10 ].
599+ dbg step.
600+ self assert: dbg temporaries size equals: 1 .
601+ self assert: (dbg temporaryNamed: #a ) equals: nil .
602+ dbg step.
603+ self assert: (dbg temporaryNamed: #a ) equals: 5
604+ ]
605+
606+ { #category : #tests }
607+ SindarinDebuggerTests >> testTopStack [
608+ | a dbg |
609+ a := 1 .
610+ dbg := SindarinDebugger debug: [ a := 2 ].
611+ dbg step.
612+ self assert: dbg topStack equals: 2
613+ ]
614+
561615{ #category : #tests }
562616SindarinDebuggerTests >> testWhenHitBreakpoint [
563617 | breakpoint toggle scdbg |
0 commit comments