Skip to content

Commit

Permalink
added more comments; printing is mostly in place; still need patch pa…
Browse files Browse the repository at this point in the history
…ge tests...
  • Loading branch information
mlmcl62 committed Aug 19, 2021
1 parent 3a411a6 commit 283c58c
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Image Address Badge
; Check if Image Addressing is supported by the driver. This is a badge, meaning that failure will not
; Check if Image Addressing is supported by the driver. This is a badge, failure does not
; invalidate scanner certification. Instead, passage adds Image Address support to the cert.
;
; The following are required:
; CAP_IAFIELDA_LEVEL, CAP_IAFIELDB_LEVEL, CAP_IAFIELDC_LEVEL, CAP_IAFIELDD_LEVEL
; CAP_IAFIELDA_PRINTFORMAT, CAP_IAFIELDB_PRINTFORMAT, CAP_IAFIELDC_PRINTFORMAT, CAP_IAFIELDD_PRINTFORMAT
; CAP_IAFIELDA_VALUE, CAP_IAFIELDB_VALUE, CAP_IAFIELDC_VALUE, CAP_IAFIELDD_VALUE
; TWEI_IALEVEL (values TWIA_FIXED, TWIA_LEVEL1, TWIA_LEVEL2, TWIA_LEVEL3)
; TWEI_IAFIELDA_VALUE, TWEI_IAFIELDA_VALUE, TWEI_IAFIELDA_VALUE, TWEI_IAFIELDA_VALUE
;
; If the scanner supports printing, the following are required:
; CAP_PRINTERMODE (value TWPM_IMAGEADDRESSSTRING)
; TWEI_PRINTERTEXT
;
; The following are optional, and only tested if present in the driver:
; CAP_IAFIELDE_LEVEL
; CAP_IAFIELDE_PRINTFORMAT
; CAP_IAFIELDE_VALUE
; TWEI_IALEVEL (value TWIA_LEVEL4)
; TWEI_IAFIELDE_VALUE
;
; Arguments
; arg:1 - TW_IDENTITY.ProductName of scanner to test
; arg:2 - global to set on fail
Expand All @@ -25,10 +43,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialize stuff, load tables if not already done for us...
;
echo.titlesuite 'Image Address Badge v1.0 17-May-2021'
echo.titlesuite 'Image Address Badge v1.0 16-Aug-2021'
echo.yellow '************************************************************************************'
echo.yellow '*** This test is for the Image Address Badge. Failing means the driver does not ***'
echo.yellow '*** support this functionality. It does not prevent it from being certified. ***'
echo.yellow '*** support this functionality. It does not prevent certification. ***'
echo.yellow '************************************************************************************'
setlocal twidentity.productname '${arg:1}'
setglobal g_localcertifyresult 'pass' ; assume success
Expand All @@ -39,7 +57,7 @@ run '${folder:certification}/LoadTables'


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Run the tests...
; Open the scanner driver, run the tests, close the scanner driver...
;
call CERTIFY '${folder:certification}/Opends' '${get:twidentity.productname}' g_localcertifyresult embedded
if '${get:g_localcertifyresult}' != 'pass' goto MAIN.CLOSEDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ echo.passfail '${get:indent}${get:name}' 'pass'


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialize for the loop that'll go through the values...
; Initialize for the loop that'll go through the values.
; iafieldindex is the index into iafieldvalue
; iafieldvalue is the array of fields we'll be checking
;
setlocal iafieldindex 0
setlocal iafieldvalue 'PLACEHOLDER,TWEI_IAFIELDA_VALUE,TWEI_IAFIELDB_VALUE,TWEI_IAFIELDC_VALUE,TWEI_IAFIELDD_VALUE,TWEI_IAFIELDE_VALUE'
Expand Down Expand Up @@ -160,7 +162,22 @@ setlocal name 'TW_INFO[${get:iafieldindex}].InfoID is ${getindex:iafieldvalue:${
if '${getindex:imageaddressdata:${get:twinfo.infoid.index}}' != '${getindex:iafieldvalue:${get:iafieldindex}}' goto MAIN.ERROR.ECHOPASSFAIL
echo.passfail '${get:indent}${get:name}' 'pass'
;
; totalfields indicates the number of iafields we negotiated with a level
; other than TWIA_UNUSED, so we require a status of success from them.
if '${get:iafieldindex}' <= '${get:totalfields}' goto MAIN.TWINFO.FIELDHASDATA
;
; TWEI_IAFIELDE_VALUE is a special case, jump there when we detect it.
; For the other fields we require a status return of TWRC_DATANOTAVAILABLE
; if the field is currently disabled.
if '${getindex:iafieldvalue:${get:iafieldindex}}' == 'TWEI_IAFIELDE_VALUE' goto MAIN.TWINFO.TWEI_IAFIELDE_VALUE
setlocal name 'TW_INFO[${get:iafieldindex}].ReturnCode is TWRC_DATANOTAVAILABLE'
if '${getindex:imageaddressdata:${get:twinfo.returncode.index}}' != 'TWRC_DATANOTAVAILABLE' goto MAIN.ERROR.ECHOPASSFAIL
echo.passfail '${get:indent}${get:name}' 'pass'
goto MAIN.TWINFO.DONE
;
; Support for TWEI_IAFIELDE_VALUE is optional, so it's okay for it to
; return a value of either TWRC_DATANOTAVAILABLE or TWRC_INFONOTSUPPORTED.
:MAIN.TWINFO.TWEI_IAFIELDE_VALUE
setlocal name 'TW_INFO[${get:iafieldindex}].ReturnCode is TWRC_DATANOTAVAILABLE or TWRC_INFONOTSUPPORTED'
if '${getindex:imageaddressdata:${get:twinfo.returncode.index}}' == 'TWRC_DATANOTAVAILABLE' goto MAIN.TWINFO.FIELDHASNODATA
if '${getindex:imageaddressdata:${get:twinfo.returncode.index}}' == 'TWRC_INFONOTSUPPORTED' goto MAIN.TWINFO.FIELDHASNODATA
Expand All @@ -169,6 +186,7 @@ goto MAIN.ERROR.ECHOPASSFAIL
echo.passfail '${get:indent}${get:name}' 'pass'
goto MAIN.TWINFO.DONE
;
; If we got here we expect valid data, check each of the TW_INFO fields...
:MAIN.TWINFO.FIELDHASDATA
setlocal name 'TW_INFO[${get:iafieldindex}].ReturnCode is TWRC_SUCCESS'
if '${getindex:imageaddressdata:${get:twinfo.returncode.index}}' != 'TWRC_SUCCESS' goto MAIN.ERROR.ECHOPASSFAIL
Expand All @@ -186,7 +204,8 @@ echo.passfail '${get:indent}${get:name}' 'pass'
setlocal handle ${getindex:imageaddressdata:${get:twinfo.item.index}}
setlocal fieldavalue '${gethandle:${get:handle}:TWTY_STR32:0}'
;
; Only do this test if the field we're working on matches fixedfieldname...
; Do this test if the field we're working on matches fixedfieldname,
; we want to make sure the string we set it to comes back to us...
if '${getindex:imageaddressdata:${get:twinfo.itemtype.index}}' != '${get:fixedfieldname}' goto MAIN.TWINFO.NEXT
setlocal name 'TW_INFO[${get:iafieldindex}].Item contains "${get:fixedfieldvalue}" (${get:printertext})'
if '${get:printertext}' !contains '${get:fixedfieldvalue}' goto MAIN.ERROR.ECHOPASSFAIL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; DAT_IMAGENATIVEXFER
; This test scans one sheet of paper for the default pixeltype. An ADF
; is required to pass this test, but that was already been tested before
; we got to this function.
; This test scans one sheet of paper for the default pixeltype. An ADF is required to pass this test,
; but that was already been confirmed before we got to this function. We're going to set the driver,
; scan a sheet of paper, and check the TWEI_* values.
;
; Here's the basic flow:
; SetCapabilities
Expand All @@ -13,12 +13,13 @@
; end image
; end
; end scanning
; verify the results
;
; The test passes if:
; - all of the capabilities can be set
; - TWEI_PRINTER matches CAP_PRINTER
; - TWEI_PRINTERSTRING starts with 'TWAIN' and ends with 'TEST'
; - all of the CAP_IAFIELD*_* capabilities can be set
; - scanning is successful
; - the TWEI_IALEVEL and TWEI_IAFIELD*_VALUE field are correctly set
; - if printing is supported, CAP_PRINTERMODE can be set and
; CAP_PRINTERTEXT contains the correct value
;
; Arguments
; arg:1 - TW_IDENTITY.ProductName of scanner to test
Expand Down Expand Up @@ -51,7 +52,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialize...
;
;echo.titletest 'DAT_IMAGENATIVEXFER v1.0 30-Jul-2021'
;echo.titletest 'DAT_IMAGENATIVEXFER v1.0 16-Aug-2021'
;
setlocal updateonfailure '${arg:2}'
setlocal showui '${arg:3}'
Expand All @@ -67,7 +68,8 @@ setlocal image.handle '0'
setlocal image.count '1'
setlocal image.folder '${folder:certimages}/${arg:4}/DAT_IMAGENATIVEXFER'
;
; Figure out how many iafields have data, and get the fixed field value, if any...
; Figure out how many iafields have data, and get the fixed field value,
; if any. We're use them to check the TWEI_* values...
setlocal totalfields 0 ; assume no fields
setlocal argindex 5 ; first ia field argument - 1
setlocal fixedfieldvalue '' ; assume we don't have a value
Expand All @@ -84,22 +86,6 @@ goto MAIN.PARSE.NEXT



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Prompt the user...
;
;echo.prompt
;echo.prompt "Scanning will take place during this test. There will be no"
;echo.prompt "need to press any button on the TWAIN user interface to start"
;echo.prompt "the scanner. A progress indicator may appear during scanning."
;echo.prompt
;echo.prompt "Place 1 sheet in the scanner's feeder. The scanner will print"
;echo.prompt "text on this sheet."
;echo.prompt
;pause '(press the ENTER key when ready to continue)'
;echo.prompt



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clean the image folder for this test...
;
Expand All @@ -115,7 +101,6 @@ image cleanfolderandmeta '${get:image.folder}'
run SetCapabilities 'TWSX_NATIVE' '${get:indent}' '${get:totalfields}' '${get:fielda}' '${get:fieldb}' '${get:fieldc}' '${get:fieldd}' '${get:fielde}'
setlocal returnvalue ${ret:}
if '${ret:}' != 'skip' goto MAIN.SETCAPABILITES.CHECKPASS
if '${get:totalfields}' == '5' goto MAIN.SKIP
goto MAIN.SETCAPABILITES.DONE
;
:MAIN.SETCAPABILITES.CHECKPASS
Expand Down
Loading

0 comments on commit 283c58c

Please sign in to comment.