TypeTest

VisualSim Block Documentation ›› Full Library ›› Model ›› Utility ›› Checkers ››
Parent Previous Next

Full Library / Model / Utility / Checkers /  TypeTest
Block Name: TypeTest

An actor that can be used for regression test of the type resolution system. During the initialize phase, after type resolution has been performed, this actor compares resolved types in the model with types stored in several parameters. If the types are the same, then the actor does nothing. However, if the types are different, then the actor throws an exception. Hence, as with the Test actor, this actor can be easily used to build automatically executed tests of the type system from within ModelBuilder.

The types expected by this actor are stored in two parameters, each parameter contains a record of record of strings. The outer record contains labels corresponding to the names of actors in the same level of hierarchy as this actor. The inner record contains labels corresponding to the names of typeable objects in the appropriate actor. The strings in the record correspond to string representations of the types of the typeable objects. For the portTypes parameter, the typeable objects are assumed to be ports, and for the parameterTypes parameter, the objects are assumed to be parameters.

Note that this actor only tests type resolution at one level of opaque hierarchy. Hierarchical models should include multiple instances of this actor. Since filling in the types manually is difficult, this actor includes a training mode, similar to the NonStrictTest actor. This mode automatically fills in the type parameters. Also note that it is not necessary to specify the types of all typeable objects. Any objects for which no type is specified are not checked.

During runtime, this actor consumes and ignores any input tokens. This makes it very easy to add this actor to an existing model without changing the behavior of the model.


Field Detail

parameterTypes

public VisualSim.data.expr.Parameter parameterTypes


portTypes

public VisualSim.data.expr.Parameter portTypes


trainingMode

public VisualSim.data.expr.Parameter trainingMode



Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents