-- $Source: /commtar/monoBANK/CICS_INTF/fc_b_1.ada,v $ -- $Revision: 1.7 $ $Date: 88/03/30 18:30:13 $ $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_b_1 ---------------- is use Numbered_line_file_pkg; package NLF renames Numbered_line_file; Host_rec : Host_numbered_line_record; Host_Rec_Ptr : NLF.Element_Ptr_Type; Rec : Numbered_line_record; Host_key : Host_count_type(1..6); Key : Count_type; Subkey : string(1..4); begin Start_module("fc_b_1", "raise Not_Found"); Flush_numbered_line_file; Key := Pad(" 89990", Key'length); Rec.count := Key; Rec.line:= Pad("This is a record in the file", Rec.line'Length); NLF.Write(File=>Recfile, From=>To_host(Rec), Key=>To_host_string(Key)); declare begin Start_test("fc_b_1_a", "raise Not_Found by reading with exact key"); Key := Pad(" 88888", Key'Length); NLF.Read(File=>Recfile, Element=>Host_Rec, Key=>To_host_string(Key)); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_b", "raise Not_Found by reading with generic key"); SubKey := Pad("8888", Subkey'Length); NLF.Read(File=>Recfile, Element=>Host_Rec, Key=>To_host_string(Subkey), Generic_Key=>True); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_c", "raise Not_Found by reading with gt_eq key"); Key := Pad(" 88888", Key'Length); NLF.Read(File=>Recfile, Element=>Host_Rec, Key=>To_host_string(Key), Gt_eq=>TRUE); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_d", "raise Not_Found by deleting with exact key"); Key := Pad ("88888", Key'Length); NLF.Delete(File=>Recfile, Key=>To_host_string(Key)); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_e", "raise Not_Found by Start_browse with exact " & "key"); Key := Pad("88888", Key'Length); NLF.Start_Browse(File=>Recfile, Key=>To_host_string(Key), Gt_Eq=>FALSE); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_f", "raise Not_Found by Read_next with exact " & "key"); Key := Pad("90000", Key'Length); Host_key := To_host_string(Key); NLF.Read_next(File=>Recfile, Element_Ptr=>Host_rec_ptr, Key=>Host_key); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_g", "raise Not_Found by Read_prev with exact " & "key"); Key := Pad("90000", Key'Length); Host_key := To_host_string(Key); NLF.Read_prev(File=>Recfile, Element_Ptr=>Host_rec_Ptr, Key=>Host_key); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_b_1_h", "raise Not_Found by Reset_Browse with exact " & "key"); Key := Pad("90000", Key'Length); NLF.Reset_browse(File=>Recfile, Key=>To_host_string(Key), Gt_Eq=>FALSE); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; Flush_numbered_line_file; NLF.End_browse(File=>Recfile); End_module; end;