From: Michael v. A. <mi...@de...> - 2001-11-22 11:32:22
|
re...@in... writes: > > In general, Oberon 1 compiler that accepts ASSERT supersets the > > language. I offer to add in each test that contains ASSERT the > > following text just after const/var/type declarations: > > > > PROCEDURE ASSERT(condition:BOOLEAN); > > BEGIN > > IF ~condition THEN > > HALT(99); > > END; > > END ASSERT; > > > > The only trouble of this solution is that it does not accepts > > different error codes. But it is better than to expect implementation > > of ASSERT in Oberon 1 compiler. Furthermore, this procedure allows to > > count its calls in global variable and to show this number after test > > finish thus allowing to check if all ASSERTs were reached or not. > > This is of course a possible solution. If it would be up to me, > I would rather spend my time adding new tests to the test-suite. > Anyway such a change shall be submitted to the mailing-list, to see > if anybody has objections or comments to your proposal. Error codes are used extensively in some tests. Also, for some compilers ASSERT and HALT differ in the output shown to the user. For example, with oo2c ASSERT also dumps the code and a stack backtrace to stderr, while HALT only sets the program's exit code. -- mva |