Exemplo n.º 1
0
 void
 verifyBasicProperties()
   {
     CHECK (1024 < sizeof(TestFrame));
     
     TestFrame frameA;
     TestFrame frameB;
     TestFrame frameC(5);
     
     CHECK (frameA == frameB);
     CHECK (frameA != frameC);
     CHECK (frameB != frameC);
     
     CHECK (frameA.isAlive());
     CHECK (frameB.isAlive());
     CHECK (frameC.isAlive());
     
     CHECK (frameA.isSane());
     CHECK (frameB.isSane());
     CHECK (frameC.isSane());
     
     void * frameMem = &frameB;
     
     CHECK (frameA == frameMem);
     corruptMemory(frameMem,20,5);
     CHECK (!frameB.isSane());
     
     frameB = frameC;
     
     CHECK (frameB.isSane());
     CHECK (frameA != frameB);
     CHECK (frameA != frameC);
     CHECK (frameB == frameC);
   }
Exemplo n.º 2
0
 void
 verifyFrameLifecycle()
   {
     CHECK (!TestFrame::isDead  (this));
     CHECK (!TestFrame::isAlive (this));
     
     TestFrame* onHeap = new TestFrame(23);
     CHECK ( TestFrame::isAlive (onHeap));
     CHECK (!onHeap->isDead());
     CHECK (onHeap->isAlive());
     CHECK (onHeap->isSane());
     
     delete onHeap;
     CHECK ( TestFrame::isDead  (onHeap));
     CHECK (!TestFrame::isAlive (onHeap));
   }
Exemplo n.º 3
0
 void
 verifyFrameLifecycle()
   {
     CHECK (!TestFrame::isDead  (this));
     CHECK (!TestFrame::isAlive (this));
     
     static char buffer[sizeof(TestFrame)];
     TestFrame* frame = new(&buffer) TestFrame(23);
     
     CHECK ( TestFrame::isAlive (frame));
     CHECK (!frame->isDead());
     CHECK (frame->isAlive());
     CHECK (frame->isSane());
     
     frame->~TestFrame();
     CHECK ( TestFrame::isDead  (frame));
     CHECK (!TestFrame::isAlive (frame));
   }