-- $Source: /commtar/monoBANK/CICS_INTF/fc_c_7.ada,v $ -- $Revision: 1.1 $ $Date: 88/03/15 18:09:33 $ $Author: chris $ with CICS_test_reporter; use CICS_test_reporter; with File_control_testing_utility; use File_control_testing_utility; with Host_character_pkg; use Host_character_pkg; with CICS_exceptions; use CICS_exceptions; ---------------- procedure fc_c_7 ---------------- is begin Start_module("fc_c_7", "write and read using keys of differents types " & "for Data Type Files"); declare use Int_file_pkg; package I renames Int_file; Key : integer; Rec : Int_record; begin Start_test("fc_c_7_a", "write and read record using integer key"); Key := 1; Rec.Field := Key; I.Write(File=>Intfile, From=>Rec, Key=>Key); I.Read(File=>Intfile, Element=>Rec, Key=>Key, Update=>TRUE); if Rec.Field /= Key then Fail_test; else Pass_test; end if; I.Delete(File=>Intfile); exception when Not_open => Unexpected_exception("Not_open"); when Not_Found => Unexpected_exception("Not_found"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); when Others => Unexpected_exception("undocumented exception"); end; declare use Enum_file_pkg; package EF renames Enum_file; Key : Enum; Rec : Enum_record; begin Start_test("fc_c_7_b", "write and read record using enumerated key"); Key := THREE; Rec.Field := Key; EF.Write(File=>Enumfile, From=>Rec, Key=>Key); EF.Read(File=>Enumfile, Element=>Rec, Key=>Key, Update=>TRUE); if Rec.Field /= Key then Fail_test; else Pass_test; end if; EF.Delete(File=>Enumfile); exception when Not_open => Unexpected_exception("Not_open"); when Not_Found => Unexpected_exception("Not_found"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); when Others => Unexpected_exception("undocumented exception"); end; declare use Comp_file_pkg; package CF renames Comp_file; Key : Key_record; Rec : Comp_record; begin Start_test("fc_c_7_c", "write and read record using composite key"); Key.I1 := 1; Key.I2 := 2; Rec.Field := Key; CF.Write(File=>Compfile, From=>Rec, Key=>Key); CF.Read(File=>Compfile, Element=>Rec, Key=>Key, Update=>TRUE); if Rec.Field /= Key then Fail_test; else Pass_test; end if; CF.Delete(File=>Compfile); exception when Not_open => Unexpected_exception("Not_open"); when Not_Found => Unexpected_exception("Not_found"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); when Others => Unexpected_exception("undocumented exception"); end; End_module; End;