From: Barbini U. <Ube...@ce...> - 2001-05-09 07:53:54
|
> > a) the start-stop is a block (which is, I think, the > > intention), so if it passes that block, it will > > process subsequent "blocks" (ie Other Check(..) > > statements or whatever). > > Hmmm. The exception checking functionality was implemented by someone > else. > I think it was me. > After reviewing the implementation, it seemed to me that StopExpecting is > not intended to be called by descendant classes and so should be a private > method. Yet I agree that even after that change the functionality would > remain confusing. > I didn't follow dunit lately. Where is exactly the problem. I meant the code as follow: procedure ..mytest StartExpectingException(myException); IstructionToTest; StopExpectingException; > > b) remove the start..stop construct altogether from > > the suite, and offer only the CheckException > > procedure. > How it's implemented? I'm out of cvs now. I did the Start/Stop so, because the pascal cannot pass a general istruction to a function. > > In this latter case, test procedures then would take > > the 'simple' form > > > > procedure TTestSomeClass.TestSomething; > > begin > > Check(SomeCondition,'Error'); > > CheckException(SomeErrorGenerator..) > > Check(AnotherCondition ....) > > ..and so on > > end; > > > > which ensures simplicity of test code while allowing > > multiple Check or CheckException routines in a test > > case, if the developer so desired. > I'm curious to see the code of CheckException because I wan't able to do so. The exception is raised before of entering the function. Bye Uberto |