mardi 19 juin 2018

Google Mock for nullptr testing

I am going to test this part of code using GMock. I want to check that start method does not execute when BPtr is null.

What is best practice to check this kind of scenario?

 currentPtr=APtr;

         if(nullptr != APtr->BPtr)
          {
            object.start(currentPtr);
          }

Aucun commentaire:

Enregistrer un commentaire