Skip to content

Add unit test for BwdTrans operator

Thibault Lestang requested to merge minimal_testing into master

This adds a starting point for a unit test validating the currently implemented BwdTrans operator. This is also infrastructure and a template for testing future operators implementation as they are integrated. The unit test is based on Boost.Test. Other popular options exist but if I remember well boost.test is already used for testing some parts of Nektar++.

The test uses a fixture structure InitFields for which the constructor and destructor is called at the beginning and end of the test. It provides access to two (input/output) Field instance that can be then passed to the operator. Member of the fixture object are accessible within the test block without prefixing their name with obj. but for clarity fixture members are prefixed with fixt_.

Code responsible for creating the fields is taken straight from main.cpp, although the session file is hardcoded in the fixture constructor.

  • The InitFields fixture currently has pointers to fields as attributes. This bypasses the need for a Field default constructor which the class currently doesn't have -- not obvious to me how t o initialise Field members in that case.
  • The test currently fails reporting that no session file was given.

Merge request reports