(FILECREATED "18-Mar-85 12:00:12" {PHYLUM}<MITTAL>LISP>LTKBTESTS.;2 11067 previous date: "15-Mar-85 12:04:19" {PHYLUM}<MITTAL>LISP>LTKBTESTS.;1) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT LTKBTESTSCOMS) (RPAQQ LTKBTESTSCOMS ((* File created by MITTAL) (* Database of test instances for Knowledge Base Tests) (CLASSES) (METHODS) (FNS) (VARS) (INSTANCES * LTKBTESTINSTANCES))) (* File created by MITTAL) (* Database of test instances for Knowledge Base Tests) (DEFCLASSES) (RPAQQ LTKBTESTINSTANCES (LTEOld LTECommunity LTENew LTEDumpToKB LTESummarize LTEThawKB LTEMakeCurrent LTEAssocKB LTEFreezeKB LTECancel LTEDelete LTEMapObjectNames LTP79 LTP78 LTP75 LTP80)) [DEFINST LOOPSTestEnvironment (LTEOld "NPR@@A") (name #(LTEOld NIL RememberName)) (SetUp (PROGN (ATEST (SEND ($ KB) Old (QUOTE LTKB1) (QUOTE E2)) "open KB created by LTENew") (SEND ($ E2) Open)) Tested? #(? NIL FlashTestBrowser)) [TestExpr (AND (ATEST (GetObjectRec (QUOTE LOOPSCasesEnv)) "class object is there") (ATEST (GetObjectRec (QUOTE LKB1)) "instance is there") (type? instance ($ LKB1)) (EQ (Class ($ LOOPSCasesEnv)) ($ LOOPSCasesMeta] (Tested? #(? NIL InformTestBrowser)) (TestDesc "Previously created KB") (PreTestOf ?) (SubTest #((LTP79 LTP78 LTP75) NIL MakeBackLink) Tested? ?) (PreTest #((LTFClass LTFtype? LTENew) NIL MakeBackLink) Tested? ?) (SyntaxTest ? Tested? ?) (AltTest ? Tested? ?)] [DEFINST LOOPSTestEnvironment (LTECommunity "NPR@@A") (name #(LTECommunity NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB2) (QUOTE E3) T) (ATEST (SEND ($ LTKB2) AddToContents (QUOTE LT1)) "add a community KB") (SEND ($ E3) Open) (SEND ($ LOOPSCasesCommunity) New (QUOTE LCKBA)) (SEND ($ E3) Close) (SEND ($ KB) Old (QUOTE LTKB2) (QUOTE E3B)) (SEND ($ E3B) Open))) (TestExpr (AND (ATEST (GetObjectRec (QUOTE LOOPSCasesCommunity)) "class from community KB is there") (ATEST (GetObjectRec (QUOTE LCKBA)) "instance created in this KB is there") (ATEST (GetObjectRec (QUOTE LCKB1)) "instance from community KB is there"))) (Tested? #(? NIL InformTestBrowser)) (TestDesc "Starting from a Community KB: new user KB") (PreTestOf ?) (SubTest #((LTP78 LTP75) NIL MakeBackLink) Tested? ?) (PreTest #((LTEOld) NIL MakeBackLink) Tested? ?) (SyntaxTest ? Tested? ?) (AltTest ? Tested? ?)] [DEFINST LOOPSTestEnvironment (LTENew "NPR@@A") (name #(LTENew NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB1) (QUOTE E1) T) (SEND ($ E1) Open) (SEND ($ LOOPSCasesMeta) New (QUOTE LOOPSCasesEnv) (QUOTE (LOOPSTestCases))) (SEND ($ LOOPSCasesEnv) Add (QUOTE CV) (QUOTE Instances) NIL) (SEND ($ LOOPSCasesEnv) Add (QUOTE CV) (QUOTE InstancePrefix) (QUOTE LKB)) (SEND ($ LOOPSCasesEnv) Add (QUOTE CV) (QUOTE UnnamedInstanceCount) 0) (SEND ($ LOOPSCasesEnv) New) (SEND ($ E1) Cleanup) (SEND ($ E1) Close)) Tested? #(? NIL FlashTestBrowser)) [TestExpr (AND (NULL (GetObjectRec (QUOTE LOOPSCasesEnv))) (NULL (GetObjectRec (QUOTE LKB1] (Tested? #(? NIL InformTestBrowser)) (TestDesc "Creating a new KB") (PreTestOf ?) (SubTest #(NIL NIL MakeBackLink) Tested? ?) (PreTest #((LTMDestroyInObj LTMDestroyInClass LTFGetObjectRec LTP21 LTP66 LTMNew) NIL MakeBackLink) Tested? ?) (SyntaxTest ? Tested? ?) (AltTest ? Tested? ?)] [DEFINST LOOPSTestEnvironment (LTEDumpToKB "NQR@@AK") (name #(LTEDumpToKB NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTESummarize "NQR@@AI") (name #(LTESummarize NIL RememberName)) (SetUp (PROGN (CreateLTKBS1) (SEND ($ KB) Summarize (QUOTE LTKBS1) (QUOTE LTKB10)) (SEND ($ KB) Old (QUOTE LTKB10) (QUOTE E11)) (SEND ($ E11) Open))) (TestExpr (ANDALL (GetObjectRec (QUOTE LOOPSEnvSumm)) (GetObjectRec (QUOTE LOOPSEnvTest)) (GetObjectRec (QUOTE LESAA)) (GetObjectRec (QUOTE LESA2)) (ATEST (NOT (GetObjectRec (QUOTE LESA1))) "destroyed objects are deleted") (ATEST (NOT (GetObjectRec LTV11)) "unreferenced unnnamed objects are deleted") (ATEST (GetObjectRec LTV12) "referenced unnamed objects are retained:UID is same") (ATEST (EQUAL (GetValue ($ LESAA) (QUOTE Etest)) (QUOTE New)) "new value overrides older") (ATEST (GetObjectRec (GetValue ($ LESA2) (QUOTE Link))) "referenced unnamed objects are retained: they are objects") (ATEST (EQUAL (GetValue (GetValue ($ LESA2) (QUOTE Link)) (QUOTE Key)) (QUOTE LESA2)) "referenced unnamed objects are retained: their structure is same")) ) (TestDesc "Summarize KB: single KB") (PreTest #((LTEOld LTMDestroyInClass LTMAdd) NIL MakeBackLink))] [DEFINST LOOPSTestEnvironment (LTEThawKB "NQR@@AN") (name #(LTEThawKB NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTEMakeCurrent "NQR@@AO") (name #(LTEMakeCurrent NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTEAssocKB "NQR@@AL") (name #(LTEAssocKB NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTEFreezeKB "NQR@@AM") (name #(LTEFreezeKB NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTECancel "NQR@@AP") (name #(LTECancel NIL RememberName))] [DEFINST LOOPSTestEnvironment (LTEDelete "NPR@@AS") (name #(LTEDelete NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB3) (QUOTE E4) T) (SEND ($ LTKB3) AddToContents (QUOTE LT1)) (SEND ($ E4) Open) (SEND ($ LCKB1) Destroy) (SEND ($ E4) Close) (SEND ($ KB) Old (QUOTE LTKB3) (QUOTE E5)) (SEND ($ E5) Open)) Tested? #(? NIL FlashTestBrowser)) (TestExpr (ATEST (NULL (GetObjectRec (QUOTE LCKB1))) "destroyed object is deleted")) (Tested? #(? NIL InformTestBrowser)) (TestDesc "Destroyed objects are deleted from KB") (SubTest ? Tested? ?) (PreTest #((LTMDestroyInClass LTECommunity) NIL MakeBackLink) Tested? ?) (SyntaxTest ? Tested? ?) (AltTest ? Tested? ?)] [DEFINST LOOPSTestEnvironment (LTEMapObjectNames "NQR@@At") (name #(LTEMapObjectNames NIL RememberName)) (TestDesc "MapObjectNames") (PreTestOf ?)] [DEFINST LOOPSTestPrimitive (LTP79 "NQR@@AH") (name #(LTP79 NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB7) (QUOTE E7) T) (SEND ($ E7) Open) (SEND ($ Class) New (QUOTE LOOPSCasesEnv) (QUOTE (NamedObject))) (SEND ($ LOOPSCasesEnv) Add (QUOTE IV) (QUOTE Link) NIL) (SEND ($ LOOPSCasesEnv) New (QUOTE LKBX)) (PutValue ($ LKBX) (QUOTE Link) (SEND ($ LOOPSCasesEnv) New)) (SEND ($ E7) Cleanup) (SEND ($ E7) Close) (SEND ($ KB) Old (QUOTE LTKB7) (QUOTE E8)) (SEND ($ E8) Open))) (TestExpr (AND (GetObjectRec (QUOTE LKBX)) (ATEST (GetObjectRec (GetValue ($ LKBX) (QUOTE Link))) "unnamed object was saved") (ATEST (EQ (Class (GetValue ($ LKBX) (QUOTE Link))) ($ LOOPSCasesEnv)) "unnamed object's class is correct"))) (TestDesc "Unnamed objects in KB") (SubTest #((LTP80) NIL MakeBackLink)) (PreTest #((LTFClass) BuildPreTest MakeBackLink)) (SubTestOf #((LTEOld) NIL MakeBackLink))] [DEFINST LOOPSTestPrimitive (LTP78 "NQR@@AG") (name #(LTP78 NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB4) (QUOTE E6) T) (ATEST (SEND ($ LTKB4) AddToContents (QUOTE LTKB2)) "add community KB") (ATEST (SEND ($ LTKB4) AddToContents (QUOTE LTKB1)) "add user KB") (SEND ($ E6) Open) (SEND ($ LOOPSCasesEnv) New (QUOTE LKBA)) (SEND ($ E6) Close) (SEND ($ KB) Old (QUOTE LTKB4) (QUOTE E6B)) (SEND ($ E6B) Open))) (TestExpr (AND (ATEST (GetObjectRec (QUOTE LOOPSCasesCommunity)) "class from 1st KB is there") (ATEST (GetObjectRec (QUOTE LOOPSCasesEnv)) "class from 2nd KB is there") (ATEST (GetObjectRec (QUOTE LCKBA)) "instance from 1st KB is there") (ATEST (GetObjectRec (QUOTE LKBA)) "instance created in this KB is there") (ATEST (GetObjectRec (QUOTE LKB1)) "instance from 2nd KB is there") (ATEST (GetObjectRec (QUOTE LCKB1)) "instance from original community KB is there"))) (TestDesc "Adding another KB to a community KB") (SubTestOf #((LTECommunity) NIL MakeBackLink))] [DEFINST LOOPSTestPrimitive (LTP75 "NPR@@A4") (name #(LTP75 NIL RememberName)) (SetUp (PROGN (SEND ($ KB) New (QUOTE LTKB5) (QUOTE E12) T) (SEND ($ LTKB5) AddToContents (QUOTE LT1)) (SEND ($ E12) Open))) (TestExpr (ATEST (NULL (GetObjectRec (QUOTE LCKBA))) "objects added in a linked KB are not added to the original KB")) (TestDesc "changes in KB do not affect community KB") (SubTestOf #((LTECommunity) NIL MakeBackLink))] [DEFINST LOOPSTestPrimitive (LTP80 "NQR@@Au") (name #(LTP80 NIL RememberName)) (SetUp (PROGN (SEND ($ KB) Old (QUOTE LTKB7) (QUOTE E9)) (SEND ($ E9) Open) [SETQ LTV10 (CAR (LAST (GetObjectNames (GetValue ($ LKBX) (QUOTE Link] (PutValue ($ LKBX) (QUOTE Link) NIL) (SEND ($ E9) Close) (SEND ($ KB) Old (QUOTE LTKB7) (QUOTE E10)) (SEND ($ E10) Open))) (TestExpr (ATEST (MEMBER LTV10 (SEND ($ E10) MapObjectNames)) "unferenced unnamed object is in the KB")) (TestDesc "Unreferenced unnamed objects are saved on KB") (PreTest #((LTFGetObjectNames LTEMapObjectNames) BuildPreTest MakeBackLink)) (SubTestOf #((LTP79) NIL MakeBackLink))] (PUTPROPS LTKBTESTS COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL))) STOP