Note

You are not reading the most recent version of this documentation.

VerificationAssertion

class Cocotec.CocoPlatform.Coco.VerificationAssertion

An assertion about a Coco file. Assertions are arranged in a tree, the structure of which is: * Root * [Module] (for each module that is known about) * [Port] (for each port defined in this module) * [Component] (for each component defined in this module) Under each [Port]/[Component] there will be further trees of assertions. The lifetime of this object is tied to the lifetime of the context in which this is created: references to a VerificationAssertion must not outlive the reference to the context.

Public Functions

string Name ()

A short human-readable name of this assertion.

string Description ()

A longer human-readable description of this assertion

Cocotec.CocoPlatform.Coco.Node Node ()

The node that this is an assertion about. This may be invalid for some group assertions.

Cocotec.CocoPlatform.Coco.SourceRange Position ()

A position that is associated with this assertion. This may not be valid, but if valid, represents a location that should be navigated to if this assertion is selected in a Coco IDE.

List<Cocotec.CocoPlatform.Coco.VerificationAssertionChildAssertions ()

Assertions are arranged into a tree; these are the child assertions of this assertion.

Cocotec.CocoPlatform.Coco.VerificationAssertion Parent ()

The parent assertion of this in the tree.

bool IsLeaf ()

Is this a leaf assertion; i.e. an assertion with no children?

bool IsGroup ()

Is this a group of assertions; i.e. an assertion with children?

bool IsRoot ()

Is this the root assertion?

bool IsModuleGroup ()

Is this an assertion group?

Cocotec.CocoPlatform.Coco.VerificationStatistics Statistics ()

If verification of this check has started or finished, returns statistics about this assertion. If this is a non-leaf assertion, then these statistics will be nullptr.

Cocotec.CocoPlatform.Coco.VerificationStatus Status ()

The status of this assertion.

void Run ()

Verifies this assertion. If this is a parent assertion, this will start verifying all child assertions (in an intelligent order).

void CancelVerify ()

May be called during run to cancel verification of this assertion. This will request cancellation of the running assertion, and will return immediately. The cancellation will happen as soon as is possible, depending on the verification backend. For example, whilst this may return immediately, the pending call to run() may only start a few seconds later. If this is called at irrelevant times, this will have no adverse affect. If this is a parent assertion, this will cancel the verification of all child assertions.

List<Cocotec.CocoPlatform.Coco.CounterexampleCounterexamples ()

If this is an assertion and the status of this is FinishedFailed, then any counterexamples that were reported.