// test1.cpp (C) 2007 adolfo@di-mare.com /** \file test1.cpp \brief Muestra de uso de \c assertTrue_Msg(). \author Adolfo Di Mare \date 2007 */ #include "BUnit.h" // 1. Agregrar #include "BUnit.h" /// Muestra de uso de \c assertTrue_Msg(). class test1 : public TestCase { // #2. Derivar de TestCase enum { N = 2 }; int m_Matrix[N][N]; public: void setUp() { for ( int i=0; i // cout /// Programa principal que ejecuta la prueba. int main() { test1 tester; tester.run(); // #4 run(): Ejecutar las pruebas if ( ! tester.wasSuccessful() ) { std::cout << tester.report(); } tester.reset(); tester.runBare(); std::cout << tester.summary(); return 0; } /* TestCase [class test1] (OK: 0) (FAIL: 4) =\_fail: m_Matrix[0][0] == 0 =/ (31) X:\DIR\SubDir\test1.cpp =\_fail: m_Matrix[0][1] == 0 =/ (31) X:\DIR\SubDir\test1.cpp =\_fail: m_Matrix[1][0] == 0 =/ (31) X:\DIR\SubDir\test1.cpp =\_fail: m_Matrix[1][1] == 0 =/ (31) X:\DIR\SubDir\test1.cpp TestCase [class test1] (OK: 4) (FAIL: 0) */ // EOF: test1.cpp