void ribi::ValentineCardDecrypterMainDialog::Test() noexcept { { static bool is_tested{false}; if (is_tested) return; is_tested = true; } { ValentineCardSymbol(0); ValentineCardSymbols(); TextCanvas(); } const TestTimer test_timer(__func__,__FILE__,1.0); ValentineCardDecrypterMainDialog d; { const boost::shared_ptr<TextCanvas> canvas { d.ToSymbolsAsString(" ") }; const boost::shared_ptr<TextCanvas> expected { new TextCanvas( { " "," "," " }, CanvasCoordinatSystem::screen ) }; if (*canvas != *expected) { TRACE("ERROR"); TRACE(*canvas); TRACE(*expected); TRACE("BREAK"); } assert(*canvas == *expected); } { const boost::shared_ptr<TextCanvas> canvas { d.ToSymbolsAsString("?") }; const boost::shared_ptr<TextCanvas> expected { new TextCanvas( { "+-+","|x ","+ " }, CanvasCoordinatSystem::screen ) }; assert(*canvas == *expected); } }
void ribi::ValentineCardDecrypterMainDialog::Test() noexcept { { static bool is_tested = false; if (is_tested) return; is_tested = true; } TRACE("Starting ribi::ValentineCardDecrypterMainDialog::Test"); ValentineCardDecrypterMainDialog d; { const boost::shared_ptr<TextCanvas> canvas { d.ToSymbolsAsString(" ") }; const boost::shared_ptr<TextCanvas> expected { new TextCanvas( { " "," "," " }, CanvasCoordinatSystem::screen ) }; if (*canvas != *expected) { TRACE("ERROR"); TRACE(*canvas); TRACE(*expected); TRACE("BREAK"); } assert(*canvas == *expected); } { const boost::shared_ptr<TextCanvas> canvas { d.ToSymbolsAsString("?") }; const boost::shared_ptr<TextCanvas> expected { new TextCanvas( { "+-+","|x ","+ " }, CanvasCoordinatSystem::screen ) }; assert(*canvas == *expected); } TRACE("Finished ribi::ValentineCardDecrypterMainDialog::Test successfully"); }