void VsnprintfTestCase::C() { CMP5("hi!", "%c%c%c", wxT('h'), wxT('i'), wxT('!')); // NOTE: // the NULL characters _can_ be passed to %c to e.g. create strings // with embedded NULs (because strings are not always supposed to be // NUL-terminated). DoMisc(14, wxT("Hello \0 World!"), 16, wxT("Hello %c World!"), wxT('\0')); }
void CAction::ExecuteAction() { switch (m_nAction) { case None: break; case ActivateControl: DoActivateControl(); break; case ActivateTab: DoActivateTab(); break; case MenuCommand: DoMenuCommand(); break; case ShowHideDialog: DoShowHideDialog(); break; case ResultListItems: DoResultListItems(); break; case Misc: DoMisc(); break; case ChangeValue: DoChangeValue(); break; case Presets: DoPresets(); break; case Help: DoHelp(); break; default: ASSERT(0); break; } }
void VsnprintfTestCase::Miscellaneous() { // expectedLen, expectedString, max, format, ... DoMisc(5, wxT("-1234"), 8, wxT("%d"), -1234); DoMisc(7, wxT("1234567"), 8, wxT("%d"), 1234567); DoMisc(-1, wxT("1234567"), 8, wxT("%d"), 12345678); DoMisc(-1, wxT("-123456"), 8, wxT("%d"), -1234567890); DoMisc(6, wxT("123456"), 8, wxT("123456")); DoMisc(7, wxT("1234567"), 8, wxT("1234567")); DoMisc(-1, wxT("1234567"), 8, wxT("12345678")); DoMisc(6, wxT("123450"), 8, wxT("12345%d"), 0); DoMisc(7, wxT("1234560"), 8, wxT("123456%d"), 0); DoMisc(-1, wxT("1234567"), 8, wxT("1234567%d"), 0); DoMisc(-1, wxT("1234567"), 8, wxT("12345678%d"), 0); DoMisc(6, wxT("12%45%"), 8, wxT("12%%45%%")); DoMisc(7, wxT("12%45%7"), 8, wxT("12%%45%%7")); DoMisc(-1, wxT("12%45%7"), 8, wxT("12%%45%%78")); DoMisc(5, wxT("%%%%%"), 6, wxT("%%%%%%%%%%")); DoMisc(6, wxT("%%%%12"), 7, wxT("%%%%%%%%%d"), 12); }