1. Error that can’t use default constructors.

Example code

class A{
public:
        A(int a, int b){}
        testFunction();
}
  • When generate tests about class member functions, Controller Tester calls the functions and measure the coverages after create instances with default constructors. In the example code above, there is no default constructor of class A, so an error may occur when creating an instance. When this error occurs, you need to modify the test to create an instance with appropriate constructor.

2. Error that can’t create an instance

  • When create tests about abstract class, an error may occur by creating an instance of the abstract class and trying to call the function on the created instance. In this case, find the class in ‘Test Info” and change ‘Constructor’ into ‘User code’. After that, modify the user code to create an instance of the class that inherits the abstract class.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.