From: Tim B. <tbi...@us...> - 2006-06-09 23:02:13
|
Update of /cvsroot/aaf/AAF/test/com/ResultToTextTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7968 Modified Files: ResultToTextTest.cpp Log Message: Add negative tests. Index: ResultToTextTest.cpp =================================================================== RCS file: /cvsroot/aaf/AAF/test/com/ResultToTextTest/ResultToTextTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ResultToTextTest.cpp 9 Jun 2006 22:52:32 -0000 1.2 --- ResultToTextTest.cpp 9 Jun 2006 23:02:08 -0000 1.3 *************** *** 364,369 **** --- 364,391 ---- } + void negativeTests() + { + AAFRESULT x = AAFRESULT_BADOPEN; + HRESULT y; + y = AAFResultToTextBufLen(x, 0); + if (y != AAFRESULT_NULL_PARAM) { + std::wcout << "*** Fail." << std::endl; + } + y = AAFResultToText(x, 0, 99); + if (y != AAFRESULT_NULL_PARAM) { + std::wcout << "*** Fail." << std::endl; + } + wchar_t tooSmall[1]; + aafUInt32 len = sizeof(tooSmall) * sizeof(wchar_t); + y = AAFResultToText(x, tooSmall, len); + if (y != AAFRESULT_SMALLBUF) { + std::wcout << "*** Fail." << std::endl; + } + } + int main() { positiveTests(); + + negativeTests(); } |