OBJECTSEMANTICS / SmallSuiteGenerator

Powered by SEMANTICS SRL
http://semantics.bo
MIT License
3 stars 2 forks source link

Problem with stack when generate Tests with Roassal #178

Closed daniapq closed 4 years ago

daniapq commented 4 years ago

When you generate tests for class RSUMLClassBuilder in method #exportTests has a error with the Stack. The error is showed only when generate Assertions for some test. The stack cannot include Temps of TestCase. An Example to reproduce the problem:

| typeInfo aBlock |
RSUMLClassBuilder createTestCaseConfig.
GARSUMLClassBuilderTest targetPackageRegex: 'Roassal3-UML'.
GARSUMLClassBuilderTest numberOfGenerations: 10.
GARSUMLClassBuilderTest numberOfStatements: 20.
GARSUMLClassBuilderTest populationSize: 25.
GARSUMLClassBuilderTest fitness: #statement.
GARSUMLClassBuilderTest stopIterations: 5.

aBlock := [ 
    ((RSUMLClassBuilder new)
    classes: RSAttachPoint withAllSubclasses)
    build canvas
].
typeInfo := STypeInfo asTypeInfo: (
        SSTypeCollector profile: aBlock onPackagesMatching: 'Roassal3-UML').
GARSUMLClassBuilderTest addTypeInfo: typeInfo withKey: 'rsclassBuilder'.
GARSUMLClassBuilderTest typeInfo: 'rsclassBuilder'.

(STestCaseFactoryPharo from: GARSUMLClassBuilderTest )
    seedBlock: aBlock;
    createTestCases;
    yourself. 
daniapq commented 4 years ago

With the new updates, the example with the problem is the following:

| typeInfo aBlock |
aBlock := [ 
            ((RSUMLClassBuilder new)
    classes: RSAttachPoint withAllSubclasses)
    build canvas ].
typeInfo := STypeInfo asTypeInfo: (
        SSTypeCollector profile: aBlock onPackagesMatching: 'Roassal3-UML').

(STestCaseFactoryPharo new)
    targetClassName: #RSUMLClassBuilder ;
    typeInfo: typeInfo;
    seedBlock: aBlock;
    createTestCases;
    yourself.