Skip to content

Commit 4095df3

Browse files
committed
Fix more tests
1 parent 6ce8cf4 commit 4095df3

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/NewTools-Debugger-Tests/StDebuggerInspectorTest.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ StDebuggerInspectorTest >> testUpdateLayoutForContextsWithAssertionFailure [
141141
self
142142
assert: assertionFailure actualObject
143143
equals:
144-
((session interruptedContext tempNamed: #aStringOrBlock) at: 2).
144+
((session interruptedContext tempNamed: #aStringOrBlock) at: 1).
145145
self
146146
assert: assertionFailure expectedObject
147147
equals:
148-
((session interruptedContext tempNamed: #aStringOrBlock) at: 1)
148+
((session interruptedContext tempNamed: #aStringOrBlock) at: 2)
149149
]
150150

151151
{ #category : 'tests' }

src/NewTools-Debugger-Tests/StDebuggerTest.class.st

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ StDebuggerTest >> testContextChangedAfterStepOverAndReturn [
330330
{ #category : 'tests - context inspector' }
331331
StDebuggerTest >> testContextTempVarList [
332332
| contextItems inspectorTable |
333-
333+
334334
dbg := self debuggerOn: session.
335335
inspectorTable := dbg inspector getRawInspectorPresenterOrNil attributeTable.
336336

@@ -342,10 +342,10 @@ StDebuggerTest >> testContextTempVarList [
342342
self assert: (contextItems at: 1) class equals: StInspectorSelfNode.
343343

344344
"Next nodes are temps"
345-
self assert: (contextItems at: 2) tempVariable isTempVariable.
346-
self assert: (contextItems at: 3) tempVariable isTempVariable.
347-
self assert: (contextItems at: 4) tempVariable isTempVariable.
348-
self assert: (contextItems at: 5) tempVariable isTempVariable.
345+
self assert: (contextItems at: 2) isTempVariable.
346+
self assert: (contextItems at: 3) isTempVariable.
347+
self assert: (contextItems at: 4) isTempVariable.
348+
self assert: (contextItems at: 5) isTempVariable.
349349

350350
"receiver"
351351
self assert: (contextItems at: 6) rawValue identicalTo: session shortStack first receiver session.
@@ -413,8 +413,8 @@ StDebuggerTest >> testContextTempVarListUpdatesTempsWhenEnteringOrLeavingInlined
413413
assert: (newContextItems at: i)
414414
identicalTo: (contextItems at: i) ].
415415

416-
self assert: (newContextItems at: 9) tempVariable isTempVariable.
417-
self assert: (newContextItems at: 9) tempVariable name equals: 'j'.
416+
self assert: (newContextItems at: 9) isTempVariable.
417+
self assert: (newContextItems at: 9) tempName equals: 'j'.
418418

419419
"We leave inlined block"
420420
2 timesRepeat: [ dbg stepOver ].
@@ -620,7 +620,6 @@ StDebuggerTest >> testDiscardCodeChangesFor [
620620
{ #category : 'tests - code pane' }
621621
StDebuggerTest >> testDynamicVariableEvaluation [
622622
|activeProcess debuggedProcess|
623-
self skipOnPharoCITestingEnvironment.
624623
debugger := StTestDebuggerProvider new
625624
debuggerWithDynamicVariableSuspendedContext.
626625
debugger initializeCode.
@@ -1307,11 +1306,11 @@ StDebuggerTest >> testUpdateLayoutForContextsIfAssertionFailure [
13071306
self
13081307
assert: assertionFailure actualObject
13091308
equals:
1310-
((session interruptedContext tempNamed: #aStringOrBlock) at: 2).
1309+
((session interruptedContext tempNamed: #aStringOrBlock) at: 1).
13111310
self
13121311
assert: assertionFailure expectedObject
13131312
equals:
1314-
((session interruptedContext tempNamed: #aStringOrBlock) at: 1)
1313+
((session interruptedContext tempNamed: #aStringOrBlock) at: 2)
13151314
]
13161315

13171316
{ #category : 'tests - code pane' }

src/NewTools-Debugger-Tests/StTestDebuggerProvider.class.st

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,25 @@ StTestDebuggerProvider >> debuggerWithDNUContext [
4141

4242
{ #category : 'helpers' }
4343
StTestDebuggerProvider >> debuggerWithDynamicVariableSuspendedContext [
44-
|process|
44+
45+
| process progressSemaphore |
46+
progressSemaphore := Semaphore new.
4547
process := [
46-
TestDynamicVariable value: 42 during: [
47-
self assert:
48-
(thisProcess psValueAt: TestDynamicVariable soleInstance index) = 42.
49-
100 milliSeconds wait.
50-
thisProcess suspend ] ] fork.
51-
session := DebugSession
52-
named: 'test session providerSessionFor:'
53-
on: process
54-
startedAt: process suspendedContext.
55-
session exception:
56-
(OupsNullException fromSignallerContext: process suspendedContext).
57-
" self assert:
58-
(process psValueAt: TestDynamicVariable soleInstance index) = 42."
48+
TestDynamicVariable value: 42 during: [
49+
self assert: (thisProcess psValueAt: TestDynamicVariable soleInstance index) = 42.
50+
"Let's tell our owner that we are inside the block!"
51+
progressSemaphore signal.
52+
"And now we suspend ourselves"
53+
thisProcess suspend ] ] fork.
5954

55+
"We wait until the process reaches the block.
56+
Then we can continue"
57+
progressSemaphore wait.
58+
59+
session := DebugSession named: 'test session providerSessionFor:' on: process startedAt: process suspendedContext.
60+
session exception: (OupsNullException fromSignallerContext: process suspendedContext).
61+
self assert: (process psValueAt: TestDynamicVariable soleInstance index) = 42.
62+
6063
^ self newDebugger
6164
]
6265

src/NewTools-Debugger/StDebugger.class.st

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,6 @@ StDebugger >> initializeInspector [
847847
inspector := self
848848
instantiate: self debuggerInspectorClass
849849
on: (self debuggerInspectorModelClass on: self newDebuggerContext).
850-
namesVisibleInPreviousScope := self newDebuggerContext context temporaryVariableNames.
851850
inspector label: 'Receiver'
852851
]
853852

@@ -1556,8 +1555,7 @@ StDebugger >> updateInspectorFromContext: aContext [
15561555
isAssertionFailure:
15571556
self debuggerActionModel isInterruptedContextAnAssertEqualsFailure.
15581557
inspector updateWith: (self newDebuggerContextFor: aContext).
1559-
self flag: #DBG_INSPECTOR_UPDATE_BUG.
1560-
inspector getRawInspectorPresenterOrNil ifNotNil: [ :p | p update ]
1558+
self updateStep
15611559
]
15621560

15631561
{ #category : 'updating' }

0 commit comments

Comments
 (0)