Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
CommandSetup_test Class Reference

Description

Test:
cover the behaviour of the CommandSetup helper intended for inserting actual command definitions into the Session.
See also
cmd.hpp
session-cmd.cpp actual usage example
steam::control::CommandSetup

Definition at line 97 of file command-setup-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void verify_DefinitionSetup ()
 
void verify_DefinitionRegistration ()
 
void verify_standardUsage ()
 

Private Attributes

_Fmt pattern {" %d times."}
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

Definition at line 101 of file command-setup-test.cpp.

References CommandSetup_test::verify_DefinitionRegistration(), CommandSetup_test::verify_DefinitionSetup(), and CommandSetup_test::verify_standardUsage().

+ Here is the call graph for this function:

◆ verify_DefinitionSetup()

void verify_DefinitionSetup ( )
inlineprivate
Test:
create some command definitions inline and verify their properties.

Definition at line 111 of file command-setup-test.cpp.

References CommandSetup_test::pattern, and CommandSetup::pendingCnt().

Referenced by CommandSetup_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_DefinitionRegistration()

void verify_DefinitionRegistration ( )
inlineprivate
Test:
actually issue the definitions captured as side-effect of the preceding test.

Definition at line 175 of file command-setup-test.cpp.

References AcceptAnyBind< TAR, BA, RET >::bind(), Command::defined(), CommandSetup::invokeDefinitionClosures(), and CommandSetup::pendingCnt().

Referenced by CommandSetup_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_standardUsage()

void verify_standardUsage ( )
inlineprivate
Test:
demonstrate the standard usage pattern of command definition setup
  • static CommandSetup instances are created "somewhere"
  • when the ON_GLOBAL_INIT lifecycle event is issued, all command definitions collected thus far are invoked and thus inserted into the steam::control::CommandRegistry
  • from this point on, we may access a control::Command handle corresponding to these definitions, and we may create derived instances to bind parameters and invoke the operation.
Remarks
this test assumes that the static initialisation of the test fixture indeed created CommandSetup instances, which – as a side-effect – also scheduled the corresponding functors for invocation. Moreover the test-suite main() in fact triggers the lifecycle event ON_GLOBAL_INIT, causing these test command definitions to be issued alongside with all the real session commands defined in the application.

Definition at line 227 of file command-setup-test.cpp.

References Command::canExec(), Command::defined(), Command::remove(), and Command::storeDef().

Referenced by CommandSetup_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ pattern

_Fmt pattern {" %d times."}
private

Definition at line 169 of file command-setup-test.cpp.

Referenced by CommandSetup_test::verify_DefinitionSetup().

+ Inheritance diagram for CommandSetup_test:
+ Collaboration diagram for CommandSetup_test:

The documentation for this class was generated from the following file: