Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/Test-Suite/SQL P/xts/   (NIST Cobol Test-Suite ©)  Datei vom 4.1.2008 mit Größe 15 kB image not shown  

Quelle  xts758.cob   Sprache: Cobol

 

 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31
PROGRAM-ID
       java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 9
       SECTION
       SOURCE-COMPUTER.  xyz.
       .  .
       DATA (!)
       SECTION


      * EMBEDDED COBOL (file "XTS758.PCO")


      *Copyright 1995 National Computing Centre Limited               
      *and Computer Logic R&D S.A                                     
      *on behalf of the CTS5 SQL2 Project.                            
      *All rights reserved.                                          
      *The CTS5 SQL2 Project is sponsored by the European Community. 
      *                                                             
      *The National Computing Centre Limited and Computer Logic R&D  
      *have given permission to NIST to distribute this program      
      *over the World Wide Web in order to promote SQL standards.    
      *DISCLAIMER:                                                   
      *This program was reviewed by employees of NIST for            
      *conformance to the SQL standards.                             
      *NIST assumes no responsibility for any party's use of         
      *this program.                                                 


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * SQL VALIDATION TEST SUITE V6.0                               
      *                                                              
      * XTS758.PCO                                                   
      * WRITTEN BY: Nickos Backalidis                                
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * Scrolled cursor FETCH ABSOLUTE non-literal after last row    
      *                                                              
      * REFERENCES                                                   
      *   13.1    -- <Declare cursor>                                
      *   13.3    -- <Fetch statement>                               
      *   13.3 GR.5b                                                 
      *   F#24    -- Keyword relaxations                             
      *   F#43    -- Scrolled cursors                                
      *                                                              
      * DATE LAST ALTERED  18/12/95 CTS5 Hand-over Test              
      *                                                              
      * Cleanups and fixes by V. Kogakis 15/12/95                    
      *        Print timestamp                                       
      *        Include Files                                         
      *        Define NOSUBCLASS/CHCKOK at test beginning            
      *                                                              
      * QA STATUS : QA CHECK                                         
      *                                                              
      * Revised by DWF 1996-02-20                                    
      *   Removed status checks after cursor definition              
      *   Shortened variable names to 6 chars                        
      *   Removed field width from printf                            
      *   Fixed string lengths                                       
      *   Fixed wrong SQLCODE expected                               
      ****************************************************************



           EXEC SQL BEGIN DECLARE SECTION END-EXEC
       01  SQLCODE PIC S9(9) COMP.
       01  SQLSTATE PIC  X(5).
       01  uid PIC  X(18).
       01  uidx PIC  X(18).
       01  num1 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  chr1 PIC  X(10).
       01  rowptr PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
             EXEC SQL END DECLARE SECTION END-EXEC
       01  norm1 PIC S9(9) java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
       01    FlashSize dnWriteSize %\n
       01 VALUEIS
               "01234 resp->flash_size, resp->write_block_size
   05  ALPNUM PIC X OCCURS 36 TIMES.
       01  NORMSQ.
           05  NORMSQX PIC X OCCURS 5 TIMES.
       01  errcntexit:
      *date_time declaration 
       01  TO-DAYkfreemsg;
       01  THE-TIMEPIC(8)
       01  flag 

       01  java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0

          struct attr  *)
       P0

             MOVE "CTS1              " TO uid
             CALL ret
             MOVE"not logged ,not TO uidx
             EXEC              
             java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
             EXEC SQL ROLLBACKmsg-command=EC_CMD_MOTION_SENSE_CMD>;
              SQLCODE  SQL-COD
ifuidNOT=  uidxuidx)then
               outsize=sizeof*)
      -    " connected"
            STOPjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
             
             MOVE 0 TO errcnt

             DISPLAY  ;
             DISPLAY
           "   struct ec_response_motion_sense *data;
             "TEd Version"
      *date_time print 
ACCEPTTO-DAY  DATE
           ACCEPT java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 12
mssff: " THE-TIME

      ******************** BEGIN TEST7058 *******************
             MOVE 1  flag
             DISPLAY "                  TEST7058"
              cursor FETCH ABSOLUTE non-literaljava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      -    " after struct cros_ec_dev *ec = to_cros_ec_dev(dev);
             DISPLAY " References"
 structec_params_motion_sense*;
             DISPLAY "    13.3    -- <Fetch statement>"
             java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 9
              "F24    --  relaxations"
               ()
 DISPLAY"   ------------    - -java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63

      *Initialise error reporting variables 
               (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        MOVE "xxxxx"TO

      *create a table under the current schema 
             DISPLAY "REATE  "
             DISPLAY "(COL1 NUMERIC(5) PRIMARY  >. =;
             DISPLAY msg->=sizeofstruct ec_response_motion_sense;
             EXECSQLCREATE TABLETAB758
               (COL1 NUMERIC(5) PRIMARY KEY UNIQUE,
               COL2 CHAR(10)) END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14

                struct device_attribute *,
             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
             MOVEcount=0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
           PERFORM java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
            DISPLAY  "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *now insert five rows in the table 
             ISPLAY "INSERT INTOTAB758VALUES(101,NICKOS);"
             EXEC SQL INSERT INTO TAB758 VALUES(101,'NICKOS') END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  struct ec_response_usb_pd_mux_inforesp_mux

             DISPLAY INSERT TAB758 (03,LUNA);"
             EXEC SQL INSERT INTO TAB758  USB_PD_MUX_USB4_ENABLED));
             MOVEjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
           PERFORM CHCKOK
             java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0

 DISPLAYINSERT INTOTAB758105LOLA;
             EXEC{
              TO
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "INSERT INTO TAB758 VALUES(102,'LILIAN')java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             EXEC SQL INSERT INTO TAB758 VALUES(102}
             static DEVICE_ATTR_RW(reboot);
           PERFORM CHCKOK
             DISPLAY   "

              INSERT  VALUES104'';
              SQLINSERT INTO TAB758 VALUES(,MARION)
             MOVE ()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
           dev_attr_kb_wake_angle
                java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "COMMIT{
             EXEC SQL struct device *dev = kobj_to_dev(kobj);
              struct cros_ec_devec=to_cros_ec_dev(dev);
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "  (a== &dev_attr_kb_wake_angle.attr && !ec->has_kb_wake_angle)
      -    " COL1,COL2"
             DISPLAY "FROM java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               = &attr){
             EXEC SQL DECLARE SCRCURS structcros_ec_platformec_platform(ec-d);
               FROMTAB758
               ORDER java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 12

            DISPLAY OPENSCRCURS"
             EXEC SQL OPEN SCRCURS END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY ""

      *initialise host variables 
             MOVE 0 TOstatic  cros_ec_sysfs_probe *pd)
             MOVE "xxxxxxxxxx" TO chr1
             5  rowptr

      *now fetch the last row of the cursor row 
             DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      -    " :num1  (et  0)
             EXEC SQL ABSOLUTE:rowptrFROMSCRCURSINTO
              returnret;
             MOVE static void cros_ec_sysfs_remove(struct platform_device *pd)
HCKOK
             DISPLAY  (ec_dev->.,&ros_ec_attr_groupjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
            DISPLAY  should LOLAitsis" 
  ,0}
 }
             END-IF
             DISPLAY  " "

      *initialise host variables 
             MOVE 0 TO num1
             MOVE  .ame=DRV_NAME
              "Nonliteral  incremented by1"
             COMPUTE rowptr = .emove=cros_ec_sysfs_remove,

             DISPLAY "FETCH ABSOLUTE :rowptr FROM SCRCURS INTO
      -" :num1,:chr1;"
             EXEC SQL FETCH ABSOLUTE :rowptr FROM SCRCURS INTO
             :num1: END-EXEC
             MOVE SQLCODE TO SQL-COD
      *Check that an exception condition no data is raised     
      *indicated in the value of SQLSTATE which should be 02000
DISPLAYSQLCODEshould; valueis,SQL-COD
             DISPLAY "SQLSTATE should be 02000; its value is ", SQLSTATE
           PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE  NOT =  100  OR  NORMSQ  NOT  =   "02000") then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ   =   "02000"  AND  NORMSQ  NOT  =   SQLSTATE)
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "

      *now decrement the host variable by 1 
      *this should return the fifth row of the table 

      *initialise host variables 
             MOVE 0 TO num1
             MOVE "xxxxxxxxxx" TO chr1
             DISPLAY "Non literal host variable is decremented by 1"
             COMPUTE rowptr = rowptr - 1

             DISPLAY "FETCH ABSOLUTE :rowptr FROM SCRCURS INTO
      -    " :num1,:chr1;"
             EXEC SQL FETCH ABSOLUTE :rowptr FROM SCRCURS INTO
             :num1,:chr1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "COL1 should be  105; its value is ", num1
             DISPLAY "COL2 should be LOLA; its value is ", chr1
             if (chr1  NOT  =   "LOLA"  OR  num1  NOT =  105) then
               MOVE 0 TO flag
             END-IF
             DISPLAY  " "

             DISPLAY "CLOSE SCRCURS;"
             EXEC SQL CLOSE SCRCURS END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *restore database in its original state 
             DISPLAY "DROP TABLE TAB758 CASCADE;"
             EXEC SQL DROP TABLE TAB758 CASCADE END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *record results 
             if ( flag  =  1 ) then
               DISPLAY "       xts758.pco  *** pass *** "
               EXEC SQL INSERT INTO CTS1.TESTREPORT
                 VALUES('7058','pass','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
             else
               DISPLAY "       xts758.pco  *** fail *** "
               EXEC SQL INSERT INTO CTS1.TESTREPORT
                 VALUES('7058','fail','PCO') END-EXEC
               MOVE SQLCODE TO SQL-COD
               COMPUTE errcnt = errcnt + 1
             END-IF

             DISPLAY "========================================"

             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
      ******************** END TEST7058 ********************

      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK.
             DISPLAY "SQLCODE should be 0; its value is ", SQL-COD
             DISPLAY "SQLSTATE should be 00000; its value is ", SQLSTATE
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE NOT =  0  OR   NORMSQ NOT = "00000") then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             .

       NOSUBCLASS.

      *This routine replaces valid implementation-defined       
      *subclasses with 000.  This replacement equates valid     
      *implementation-defined subclasses with the 000 value     
      *expected by the test case; otherwise the test will fail. 
      *After calling NOSUBCLASS, NORMSQ will be tested          
      *                          SQLSTATE will be printed.      

           MOVE SQLSTATE TO NORMSQ

           MOVE 3 TO norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYING norm2 FROM 14 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
           
      *Quit if NORMSQ is unchanged.  Subclass is not impl.-def. 
      *Changed NORMSQ means implementation-defined subclass,    
      *so proceed to zero it out, if valid (0-9,A-Z)            
           if (NORMSQ   =   SQLSTATE) then
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE 4 TO norm1
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
             MOVE "0" TO NORMSQX(norm1)
           END-IF
           END-PERFORM
   
      *implementation-defined subclasses are allowed for warnings 
      *(class = 01).  These equate to successful completion 
      *SQLSTATE values of 00000. 
      *Reference SQL-92 4.28 SQL-transactions, paragraph 2 

           if (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1") then
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=93 H=94 G=93

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.