r_test.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
class R_TEST
class R_TEST is
-- This class is a thread safe version of the TEST class in the sense
-- that more than one thread can call test(), but neither finish nor
-- test_class are thread safe.
-- It is NOT possible to instantiate more than one object of this
-- class.
-- Version 1.0 Nov 96. Copright K Hopper,U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 8 Nov 96 kh Original from Sather Sys library, etc.
include TEST
test -> t_test,
unchecked_test -> t_unchecked_test,
class_name -> t_class_name ;
-- WARNING The inclusion of the class TEST limits the portability of this
-- class. See the NOTE in the source text of that class for
-- further information.
shared lck : LL_LOCK ;
-- NOTE The class MUTEX should strictly speaking be used here and the
-- standard lock stmt. But MUTEX is already a very highlevel construct,
-- so the low level lock is used here which also permits the testing
-- of the MUTEX class too.
test(
doc_ds,
does_ds,
should_ds : $STR
) is
-- This routine carries out the test with the description `doc',
-- return value `does', and desired return value `should'. It also keeps
-- track of failures.
lck.lck ;
t_test(doc_ds,does_ds,should_ds) ;
lck.unlck
end ;
unchecked_test(
doc_ds,
does_ds,
should_ds : $STR
) is
-- This routine carries out the test with the description `doc',
-- return value `does', and desired return value `should'. It does not keep
-- track of failures.
lck.lck ;
t_unchecked_test(doc_ds,does_ds,should_ds) ;
lck.unlck
end ;
class_name(
name : STR
) is
if void(lck) then
lck := LL_LOCK::create
end ;
t_class_name(name)
end ;
end ; -- R_TEST