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

Assignation in var has errors #191

Open
daniapq opened this issue Sep 3, 2020 · 2 comments
Open

Assignation in var has errors #191

daniapq opened this issue Sep 3, 2020 · 2 comments

Comments

@daniapq
Copy link
Collaborator

daniapq commented Sep 3, 2020

In some Roassal classes, when you generate tests and try to run them, the tests can be misassigned and cause the test to fail. An example of this:

| typeInfo aBlock |
aBlock := [ 
	| animation |
	animation := RSSequentialAnimation new.
	animation := RSSequentialAnimation new
		add: (RSTransitionAnimation new duration: 2 seconds);
		yourself.
	 ].
typeInfo := STypeInfo asTypeInfo: (
		SSTypeCollector profile: aBlock onPackagesMatching: 'Roassal3-Animation').

(STestCaseFactoryPharo new)
	targetClassName: #RSSequentialAnimation;
	typeInfo: typeInfo;
	seedBlock: aBlock;
    createTestCases;
    yourself. 
@Lin777
Copy link
Collaborator

Lin777 commented Oct 1, 2020

Existen varios casos al respecto, en este ejemplo cuando se recurre a la llamada de currentTime.

	| _var0 _var1 _var2 _var3 _var4 _var5 _var6 _var7 _var8 _var9 _var10 _var11 _var12 _var13 _var14 _var15 _var16 _var17 _var18 _var19 _var20 _var21 _var22 _var23  |
	_var0 := RSSequentialAnimation new.
	_var1 := _var0 reset.
	_var2 := _var0 reset.
	_var3 := RSTransitionAnimation new.
	_var4 := _var0 add: _var3 .
	_var5 := _var3 toggle.
	_var6 := _var4 reset.
	_var7 := 1.
	_var8 := _var3 loops: _var7 .
	_var9 := _var2 initialize.
	_var10 := _var6 currentTime.
	_var11 := _var6 reset.
	_var12 := _var3 pause.
	_var13 := _var3 reset.
	_var14 := _var0 reset.
	_var15 := _var13 loops: _var7 .
	_var16 := _var13 duration.
	_var17 := _var0 reset.
	_var18 := _var9 allDuration.
	_var19 := _var14 release.
	_var20 := _var11 start.
	_var21 := _var1 noRepeat.
	_var22 := _var2 step.
	_var23 := _var2 add: _var3 .
	self deny: _var16 equals: _var18 .
	self deny: _var7 equals: _var10 .
	self assert: _var16 asSeconds equals: 2 .
	self assert: _var16 nanoSeconds equals: 0 .
	self assert: _var18 asSeconds equals: 0 .
	self assert: _var18 nanoSeconds equals: 0 .
	self assert: _var7 equals: 1 .
	self assert: _var10 equals: 1237812 .

Existe otros casos donde al recurrir a la impresion del mismo objeto se recurre a la llamada del metodo hash.

Por lo tanto se puede suponer que las llamadas a estos metodos dificilmente daran los mismos valores, por lo tanto en caso de llamar a metodos de este tipo es poco probable que los assertions de estos tipos pasen

@Lin777
Copy link
Collaborator

Lin777 commented Oct 1, 2020

Este issue, tambien estaria relacionado a este: #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants