#include "BUnit.h" // 1. Agregrar #include "BUnit.h" /// Ejemplo mínimo de uso de \c BUnit. class test0 : public TestCase { // #2. Derivar de TestCase public: bool run() { assertTrue( 1 + 1 == 3 ); // #3 Invocar assertTrue() return wasSuccessful(); } }; #include // cout /// Programa principal que ejecuta la prueba. int main() { test0 test0_instance; test0_instance.run(); // #4 run(): Ejecutar las pruebas if ( ! test0_instance.wasSuccessful() ) { std::cout << test0_instance.report(); } return 0; } /* TestCase [class test0] (OK: 0) (FAIL: 1) =\_fail: 1 + 1 == 3 =/ (7) X:\DIR\SubDir\test0.cpp */