📄 ssrch_02.cc
字号:
// file: $isip/class/search/StackSearch/ssrch_02.cc// version: $Id: ssrch_02.cc,v 1.5 2002/12/06 17:04:02 alphonso Exp $//// isip include files//#include "StackSearch.h"#include <Console.h>#include <FrontEnd.h>// method: diagnose//// arguments:// Integral::DEBUG level: (input) debug level for diagnostics//// return: logical error status//// this is the diagnostics method//boolean StackSearch::diagnose(Integral::DEBUG level_a) { //---------------------------------------------------------------------- // // 0. preliminaries // //---------------------------------------------------------------------- // output the class name // if (level_a > Integral::NONE) { SysString output(L"diagnosing class "); output.concat(CLASS_NAME); output.concat(L": "); Console::put(output); Console::increaseIndention(); } //--------------------------------------------------------------------- // // 1. required public methods // //--------------------------------------------------------------------- // set indentation // if (level_a > Integral::NONE) { Console::put(L"testing required public methods...\n"); Console::increaseIndention(); } // declare variables // StackSearch ssrch_00; ssrch_00.setNumLevels(2); if (ssrch_00.getNumLevels() != 2) { return Error::handle(name(), L"diagnose", Error::TEST, __FILE__, __LINE__); } ssrch_00.setFrame(16); if (ssrch_00.getFrame() != 16) { return Error::handle(name(), L"diagnose", Error::TEST, __FILE__, __LINE__); } ssrch_00.setFrame(128); if (ssrch_00.getFrame() != 128) { return Error::handle(name(), L"diagnose", Error::TEST, __FILE__, __LINE__); } // reset indentation // if (level_a > Integral::NONE) { Console::decreaseIndention(); } //--------------------------------------------------------------------- // // 2. class-specific public methods // //--------------------------------------------------------------------- // set indentation // if (level_a > Integral::NONE) { Console::put(L"testing class-specific public methods...\n"); Console::increaseIndention(); } //--------------------------------------------------------------------- // // 4. print completion message // //--------------------------------------------------------------------- // reset indentation // if (level_a > Integral::NONE) { Console::decreaseIndention(); } if (level_a > Integral::NONE) { SysString output(L"diagnostics passed for class"); output.concat(name()); output.concat(L"\n"); Console::put(output); } // exit gracefully // return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -