Failure testing plugins

Eric Scharff scharffe at cs.colorado.edu
Fri Aug 29 17:45:54 UTC 2003


I have a trivial plugin:

TestInterpreterPlugin subclass: #MyPlugin
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Eric-Test'

With a "primitive" method I intend to compile to C:

innerLoopX: x y: y limit: escape
	| |
	self
		primitive: 'primGuy'
		parameters: #(SmallInteger SmallInteger SmallInteger)
		receiver: #Oop.
	^ (escape + x + y) asOop: SmallInteger

(Note, simplified to do nothing useful, but illustrates the problem)

If I execute:

MyPlugin doPrimitive: 'innerLoopX:y:limit:' withArguments #(1 1 1)

I would expect to get 3.  Instead, I get a walkback:

Error: attempt to index non-existent element in an ordered collection

OrderedCollection(Object)>>error:
OrderedCollection>>errorNoSuchElement
OrderedCollection>>at:
InterpreterProxy>>stackValue:
InterpreterProxy>>stackIntegerValue:
MyPlugin>>DoItIn:
Compiler>>evaluate:in:to:notifying:ifFail:
[] in TestTMethod>>simulatePrologInContext:
Array(SequenceableCollection)>>keysAndValuesDo:
TestTMethod>>simulatePrologInContext:
MyPlugin(Object)>>primitive:parameters:receiver:
MyPlugin>>innerLoopX:y:limit:
MyPlugin class(TestInterpreterPlugin class)>>doPrimitive:withArguments:

What am I doing wrong?

-Eric



More information about the Squeak-dev mailing list