cxf3a03.a

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· A 代码 · 共 430 行 · 第 1/2 页

A
430
字号
                             FXF3A00.Foreign_Strings(i).all );            end if;         end loop;         -- Picture strings 5-9 in the Foreign_Strings array correspond         -- to data values of a decimal type with delta 0.01, and to the         -- currency string "DM" (two characters).          TC_Lower_Bound  := FXF3A00.Number_of_FF_Strings + 1;         TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +                             FXF3A00.Number_of_DM_Strings;         for i in TC_Lower_Bound..TC_Higher_Bound loop            if not Accurate_Length (FXF3A00.Foreign_Strings(i).all,                                     TwoDP,                                     TC_DM_String)            then               Report.Failed("Incorrect result from function Length, "       &                             "when used with a decimal type with delta .01 " &                             "and with the currency string " & TC_DM_String  &                              " in evaluating picture string "                &                             FXF3A00.Foreign_Strings(i).all );            end if;         end loop;         -- Picture string #10 in the Foreign_Strings array corresponds         -- to a data value of a decimal type with delta 0.01, and to the         -- currency string "CHF" (three characters).          if not Accurate_Length (FXF3A00.Foreign_Strings(10).all,                                  TwoDP,                                  TC_CHF_String)         then            Report.Failed("Incorrect result from function Length, "       &                          "when used with a decimal type with delta .01 " &                          "and with the currency string "                 &                           TC_CHF_String);         end if;      exception         when others =>            Report.Failed("Unexpected exception raised in Length_Block");      end Length_Block;      Valid_Block:      declare         -- This offset value is used to align picture string and decimal         -- data values from package FXF3A00 for proper correspondence for         -- the evaluations below.           TC_Offset : constant Natural := 10;      begin         -- The following four For Loops examine cases where the         -- decimal data/picture string/currency combinations used will          -- generate valid Edited Output strings.  These combinations, when         -- provided to the Function Valid (from instantiations of          -- Decimal_Output), should result in a return result of True.         -- The particular instantiated version of Valid used in these loops         -- is that for decimal data with delta 0.01.         -- The first 4 picture strings in the Foreign_Strings array         -- correspond to data values of a decimal type with delta 0.01,          -- and to the currency string "FF" (two characters).          for i in 1..FXF3A00.Number_of_FF_Strings loop            -- Create the picture object from the picture string.            TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);            if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),                                   TC_Picture,                                   TC_FF_String)            then               Report.Failed("Incorrect result from function Valid, "        &                             "when used with a decimal type with delta .01 " &                             "and with the currency string " & TC_FF_String  &                              " in evaluating picture string "                &                             FXF3A00.Foreign_Strings(i).all );            end if;         end loop;         -- Picture strings 5-9 in the Foreign_Strings array correspond         -- to data values of a decimal type with delta 0.01, and to the         -- currency string "DM" (two characters).          TC_Lower_Bound  := FXF3A00.Number_of_FF_Strings + 1;          TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +                             FXF3A00.Number_of_DM_Strings;         for i in TC_Lower_Bound..TC_Higher_Bound loop            -- Create the picture object from the picture string.            TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);            if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),                                   TC_Picture,                                   TC_DM_String)            then               Report.Failed("Incorrect result from function Valid, "        &                             "when used with a decimal type with delta .01 " &                             "and with the currency string " & TC_DM_String  &                              " in evaluating picture string "                &                             FXF3A00.Foreign_Strings(i).all );            end if;         end loop;         -- Picture string #10 in the Foreign_Strings array corresponds         -- to a data value of a decimal type with delta 0.01, and to the         -- currency string "CHF" (three characters).          -- Create the picture object from the picture string.         TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(10).all);         if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + 10),                                TC_Picture,                                TC_CHF_String)         then            Report.Failed("Incorrect result from function Valid, "        &                          "when used with a decimal type with delta .01 " &                          "and with the currency string "                 &                           TC_CHF_String);         end if;         -- The following For Loop examines cases where the         -- decimal data/picture string/currency combinations used will          -- generate valid Edited Output strings.           -- The particular instantiated version of Valid used in this loop         -- is that for decimal data with delta 1.0; the others above have         -- been for decimal data with delta 0.01.         -- Note: TC_Offset is used here to align picture strings from the         --       FXF3A00.Valid_Strings table with the appropriate decimal         --       data in the FXF3A00.Data_With_NDP table.         for i in 1..FXF3A00.Number_Of_NDP_Items loop            -- Create the picture object from the picture string.            TC_Picture :=                Editing.To_Picture(FXF3A00.Valid_Strings(TC_Offset + i).all);            if not Pack_NDP.Valid (FXF3A00.Data_With_NDP(i),                                   TC_Picture,                                    TC_US_String)            then               Report.Failed("Incorrect result from function Valid, "        &                             "when used with a decimal type with delta .01 " &                             "and with the currency string " & TC_US_String  &                              " in evaluating picture string "                &                             FXF3A00.Valid_Strings(i).all );            end if;         end loop;         -- The following three evaluations of picture strings, used in         -- conjunction with the specific decimal values provided, will cause          -- Editing.Image to raise Layout_Error (to be examined in other         -- tests).  Function Valid should return a False result for these          -- combinations.         -- The first two evaluations use the instantiation of Decimal_Output         -- with a decimal type with delta 0.01, while the last evaluation         -- uses the instantiation with decimal type with delta 1.0.         for i in 1..FXF3A00.Number_of_Erroneous_Conditions loop            -- Create the picture object from the picture string.            TC_Picture :=                Editing.To_Picture(FXF3A00.Erroneous_Strings(i).all);            if i < 3 then  -- Choose the appropriate instantiation.               if Pack_2DP.Valid(Item     => FXF3A00.Erroneous_Data(i),                                 Pic      => TC_Picture,                                 Currency => TC_US_String)               then                  Report.Failed("Incorrect result from function Valid, "    &                                "when used with a decimal type with delta " &                                "0.01 and with the currency string "        &                                 TC_US_String                                &                                 " in evaluating picture string "            &                                FXF3A00.Valid_Strings(i).all );               end if;            else               if Pack_NDP.Valid(Item     => FXF3A00.Decimal_Type_NDP(                                               FXF3A00.Erroneous_Data(i)),                                 Pic      => TC_Picture,                                 Currency => TC_US_String)               then                  Report.Failed("Incorrect result from function Valid, "    &                                "when used with a decimal type with delta " &                                "1.0 and with the currency string "         &                                 TC_US_String                                &                                 " in evaluating picture string "            &                                FXF3A00.Valid_Strings(i).all );               end if;            end if;         end loop;      exception         when others =>            Report.Failed("Unexpected exception raised in Valid_Block");      end Valid_Block;   exception      when others => Report.Failed ("Exception raised in Test_Block");   end Test_Block;   Report.Result;end CXF3A03;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?