add test case to buffer test suite

git-svn-id: svn+q:///qpdf/trunk@1038 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
Jay Berkenbilt 2010-10-01 11:19:36 +00:00
parent df1fa5291c
commit de05cfb508
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#include <qpdf/Pl_Count.hh>
#include <qpdf/Pl_Discard.hh>
#include <stdlib.h>
#include <stdexcept>
typedef unsigned char* uc;
@ -49,6 +50,14 @@ int main()
std::cout << "size: " << b->getSize() << std::endl;
std::cout << "data: " << b->getBuffer() << std::endl;
delete b;
unsigned char lbuf[10];
Buffer b1(lbuf, 10);
if (! ((b1.getBuffer() == lbuf) &&
(b1.getSize() == 10)))
{
throw std::logic_error("hand-created buffer is not as expected");
}
}
catch (std::exception& e)
{