@@ -159,11 +159,11 @@ (if t-sort (cadr t-sort) 3))) (define (get-curr-sort) - (vector-ref *tests-sort-options* *tests-sort-reverse*)) + (safe-vector-ref *tests-sort-options* *tests-sort-reverse*)) (define *hide-empty-runs* #f) (define *hide-not-hide* #t) ;; toggle for hide/not hide (define *hide-not-hide-button* #f) (define *hide-not-hide-tabs* #f) @@ -173,14 +173,14 @@ (debug:setup) (define uidat #f) -(define-inline (dboard:uidat-get-keycol vec)(vector-ref vec 0)) -(define-inline (dboard:uidat-get-lftcol vec)(vector-ref vec 1)) -(define-inline (dboard:uidat-get-header vec)(vector-ref vec 2)) -(define-inline (dboard:uidat-get-runsvec vec)(vector-ref vec 3)) +(define-inline (dboard:uidat-get-keycol vec)(safe-vector-ref vec 0)) +(define-inline (dboard:uidat-get-lftcol vec)(safe-vector-ref vec 1)) +(define-inline (dboard:uidat-get-header vec)(safe-vector-ref vec 2)) +(define-inline (dboard:uidat-get-runsvec vec)(safe-vector-ref vec 3)) (if (get-environment-variable "MT_RUN_AREA_HOME")(change-directory (get-environment-variable "MT_RUN_AREA_HOME"))) (define (message-window msg) (iup:show @@ -218,12 +218,12 @@ (result '()) (maxtests 0) (states (hash-table-keys *state-ignore-hash*)) (statuses (hash-table-keys *status-ignore-hash*)) (sort-info (get-curr-sort)) - (sort-by (vector-ref sort-info 1)) - (sort-order (vector-ref sort-info 2)) + (sort-by (safe-vector-ref sort-info 1)) + (sort-order (safe-vector-ref sort-info 2)) (bubble-type (if (member sort-order '(testname)) 'testname 'itempath))) ;; ;; trim runs to only those that are changing often here @@ -263,11 +263,11 @@ (define *collapsed* (make-hash-table)) ; (define *row-lookup* (make-hash-table)) ;; testname => (rownum lableobj) (define (toggle-hide lnum) ; fulltestname) - (let* ((btn (vector-ref (dboard:uidat-get-lftcol uidat) lnum)) + (let* ((btn (safe-vector-ref (dboard:uidat-get-lftcol uidat) lnum)) (fulltestname (iup:attribute btn "TITLE")) (parts (string-split fulltestname "(")) (basetestname (if (null? parts) "" (car parts)))) ;(print "Toggling " basetestname " currently " (hash-table-ref/default *collapsed* basetestname #f)) (if (hash-table-ref/default *collapsed* basetestname #f) @@ -290,12 +290,12 @@ res)) lst)) (define (collapse-rows inlst) (let* ((sort-info (get-curr-sort)) - (sort-by (vector-ref sort-info 1)) - (sort-order (vector-ref sort-info 2)) + (sort-by (safe-vector-ref sort-info 1)) + (sort-order (safe-vector-ref sort-info 2)) (bubble-type (if (member sort-order '(testname)) 'testname 'itempath)) (newlst (filter (lambda (x) (let* ((tparts (string-split x "(")) @@ -310,13 +310,13 @@ (else #t)))) inlst)) (vlst (run-item-name->vectors newlst)) (vlst2 (bubble-up vlst priority: bubble-type))) (map (lambda (x) - (if (equal? (vector-ref x 1) "") - (vector-ref x 0) - (conc (vector-ref x 0) "(" (vector-ref x 1) ")"))) + (if (equal? (safe-vector-ref x 1) "") + (safe-vector-ref x 0) + (conc (safe-vector-ref x 0) "(" (safe-vector-ref x 1) ")"))) vlst2))) (define (update-labels uidat) (let* ((rown 0) (keycol (dboard:uidat-get-keycol uidat)) @@ -328,14 +328,14 @@ (if (<= rown maxn) (vector-set! allvals rown name)) ;) (set! rown (+ 1 rown))) *alltestnamelst*) (let loop ((i 0)) - (let* ((lbl (vector-ref lftcol i)) - (keyval (vector-ref keycol i)) + (let* ((lbl (safe-vector-ref lftcol i)) + (keyval (safe-vector-ref keycol i)) (oldval (iup:attribute lbl "TITLE")) - (newval (vector-ref allvals i))) + (newval (safe-vector-ref allvals i))) (if (not (equal? oldval newval)) (let ((munged-val (let ((parts (string-split newval "("))) (if (> (length parts) 1)(conc " " (car (string-split (cadr parts) ")"))) newval)))) (vector-set! keycol i newval) (iup:attribute-set! lbl "TITLE" munged-val))) @@ -345,12 +345,12 @@ ;; (define (get-itemized-tests test-dats) (let ((tnames '())) (for-each (lambda (tdat) - (let ((tname (vector-ref tdat 0)) ;; (db:test-get-testname tdat)) - (ipath (vector-ref tdat 1))) ;; (db:test-get-item-path tdat))) + (let ((tname (safe-vector-ref tdat 0)) ;; (db:test-get-testname tdat)) + (ipath (safe-vector-ref tdat 1))) ;; (db:test-get-item-path tdat))) (if (not (equal? ipath "")) (if (and (list? tnames) (string? tname) (not (member tname tnames))) (set! tnames (append tnames (list tname))))))) @@ -367,12 +367,12 @@ (let* ((tnames '()) ;; list of names used to reserve order (tests (make-hash-table)) ;; hash of lists, used to build as we go (itemized (get-itemized-tests test-dats))) (for-each (lambda (testdat) - (let* ((tname (vector-ref testdat 0)) ;; db:test-get-testname testdat)) - (ipath (vector-ref testdat 1))) ;; db:test-get-item-path testdat))) + (let* ((tname (safe-vector-ref testdat 0)) ;; db:test-get-testname testdat)) + (ipath (safe-vector-ref testdat 1))) ;; db:test-get-item-path testdat))) ;; (seen (hash-table-ref/default tests tname #f))) (if (not (member tname tnames)) (if (or (and (eq? priority 'itempath) (not (equal? ipath ""))) (and (eq? priority 'testname) @@ -413,11 +413,11 @@ (set! *alltestnamelst* '()) ;; create a concise list of test names (for-each (lambda (rundat) (if (vector? rundat) - (let* ((testdat (vector-ref rundat 1)) + (let* ((testdat (safe-vector-ref rundat 1)) (testnames (map test:test-get-fullname testdat))) (if (not (and *hide-empty-runs* (null? testnames))) (for-each (lambda (testname) (if (not (member testname *alltestnamelst*)) @@ -435,32 +435,32 @@ (for-each (lambda (rundat) (if (not rundat) ;; handle padded runs ;; ;; id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration (set! rundat (vector (make-vector 20 #f) '() (map (lambda (x) "") *keys*))));; 3))) - (let* ((run (vector-ref rundat 0)) - (testsdat (vector-ref rundat 1)) - (key-val-dat (vector-ref rundat 2)) + (let* ((run (safe-vector-ref rundat 0)) + (testsdat (safe-vector-ref rundat 1)) + (key-val-dat (safe-vector-ref rundat 2)) (run-id (db:get-value-by-header run *header* "id")) (key-vals (append key-val-dat (list (let ((x (db:get-value-by-header run *header* "runname"))) (if x x ""))))) (run-key (string-intersperse key-vals "\n"))) ;; fill in the run header key values (let ((rown 0) - (headercol (vector-ref tableheader coln))) + (headercol (safe-vector-ref tableheader coln))) (for-each (lambda (kval) - (let* ((labl (vector-ref headercol rown))) + (let* ((labl (safe-vector-ref headercol rown))) (if (not (equal? kval (iup:attribute labl "TITLE"))) - (iup:attribute-set! (vector-ref headercol rown) "TITLE" kval)) + (iup:attribute-set! (safe-vector-ref headercol rown) "TITLE" kval)) (set! rown (+ rown 1)))) key-vals)) ;; For this run now fill in the buttons for each test (let ((rown 0) - (columndat (vector-ref table coln))) + (columndat (safe-vector-ref table coln))) (for-each (lambda (testname) (let ((buttondat (hash-table-ref/default *buttondat* (mkstr coln rown) #f))) (if buttondat (let* ((test (let ((matching (filter @@ -481,14 +481,14 @@ ((and (equal? teststate "NOT_STARTED") (member teststatus '("ZERO_ITEMS" "BLOCKED" "PREQ_FAIL" "PREQ_DISCARDED" "TIMED_OUT" "KEEP_TRYING" "TEN_STRIKES"))) teststatus) (else teststate))) - (button (vector-ref columndat rown)) + (button (safe-vector-ref columndat rown)) (color (car (gutils:get-color-for-state-status teststate teststatus))) - (curr-color (vector-ref buttondat 1)) ;; (iup:attribute button "BGCOLOR")) - (curr-title (vector-ref buttondat 2))) ;; (iup:attribute button "TITLE"))) + (curr-color (safe-vector-ref buttondat 1)) ;; (iup:attribute button "BGCOLOR")) + (curr-title (safe-vector-ref buttondat 2))) ;; (iup:attribute button "TITLE"))) (if (not (equal? curr-color color)) (iup:attribute-set! button "BGCOLOR" color)) (if (not (equal? curr-title buttontxt)) (iup:attribute-set! button "TITLE" buttontxt)) (vector-set! buttondat 0 run-id) @@ -573,12 +573,12 @@ newval)))))) (define (dashboard:update-target-selector key-lbs #!key (action-proc #f)) (let* ((runconf-targs (common:get-runconfig-targets)) (db-target-dat (db:get-targets *dbstruct-local*)) - (header (vector-ref db-target-dat 0)) - (db-targets (vector-ref db-target-dat 1)) + (header (safe-vector-ref db-target-dat 0)) + (db-targets (safe-vector-ref db-target-dat 1)) (all-targets (append db-targets (map (lambda (x) (list->vector (take (append (string-split x "/") (make-list (length header) "na")) @@ -805,12 +805,12 @@ (dboard:data-set-run-name! *data* val) (dashboard:update-run-command)))) (refresh-runs-list (lambda () (let* ((target (dboard:data-get-target-string *data*)) (runs-for-targ (db:get-runs-by-patt *dbstruct-local* *keys* "%" target #f #f)) - (runs-header (vector-ref runs-for-targ 0)) - (runs-dat (vector-ref runs-for-targ 1)) + (runs-header (safe-vector-ref runs-for-targ 0)) + (runs-dat (safe-vector-ref runs-for-targ 1)) (run-names (cons default-run-name (map (lambda (x) (db:get-value-by-header x runs-header "runname")) runs-dat)))) (iup:attribute-set! lb "REMOVEITEM" "ALL") @@ -1049,11 +1049,11 @@ (test-id (hash-table-ref/default cell-lookup key -1)) (cmd (conc toolpath " -test " (dboard:data-get-curr-run-id *data*) "," test-id "&"))) (system cmd))))) (updater (lambda () (let* ((runs-dat (db:get-runs-by-patt db *keys* "%" #f #f #f)) - (runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records + (runs-header (safe-vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records (run-id (dboard:data-get-curr-run-id *data*)) (tests-dat (let ((tdat (db:get-tests-for-run db run-id (hash-table-ref/default *searchpatts* "test-name" "%/%") (hash-table-keys *state-ignore-hash*) ;; '() (hash-table-keys *status-ignore-hash*) ;; '() @@ -1060,12 +1060,12 @@ #f #f *hide-not-hide* #f #f "id,testname,item_path,state,status"))) ;; get 'em all (sort tdat (lambda (a b) - (let* ((aval (vector-ref a 2)) - (bval (vector-ref b 2)) + (let* ((aval (safe-vector-ref a 2)) + (bval (safe-vector-ref b 2)) (anum (string->number aval)) (bnum (string->number bval))) (if (and anum bnum) (< anum bnum) (string<= aval bval))))))) @@ -1080,11 +1080,11 @@ (numcols 1) (changed #f) (runs-hash (let ((ht (make-hash-table))) (for-each (lambda (run) (hash-table-set! ht (db:get-value-by-header run runs-header "id") run)) - (vector-ref runs-dat 1)) + (safe-vector-ref runs-dat 1)) ht)) (run-ids (sort (filter number? (hash-table-keys runs-hash)) (lambda (a b) (let* ((record-a (hash-table-ref runs-hash a)) (record-b (hash-table-ref runs-hash b)) @@ -1222,11 +1222,11 @@ (mark-for-update) ;; (set! *tests-sort-reverse* *tests-sort-reverse*0) lb) ;; (iup:button "Sort -t" #:action (lambda (obj) ;; (next-sort-option) - ;; (iup:attribute-set! obj "TITLE" (vector-ref (vector-ref *tests-sort-options* *tests-sort-reverse*) 0)) + ;; (iup:attribute-set! obj "TITLE" (safe-vector-ref (safe-vector-ref *tests-sort-options* *tests-sort-reverse*) 0)) ;; (mark-for-update))) (iup:button "HideEmpty" #:action (lambda (obj) (set! *hide-empty-runs* (not *hide-empty-runs*)) (iup:attribute-set! obj "TITLE" (if *hide-empty-runs* "+HideE" "-HideE")) (mark-for-update))) @@ -1378,12 +1378,12 @@ #:expand "HORIZONTAL" #:fontsize "10" #:action (lambda (x) (let* ((toolpath (car (argv))) (buttndat (hash-table-ref *buttondat* button-key)) - (test-id (db:test-get-id (vector-ref buttndat 3))) - (run-id (db:test-get-run_id (vector-ref buttndat 3))) + (test-id (db:test-get-id (safe-vector-ref buttndat 3))) + (run-id (db:test-get-run_id (safe-vector-ref buttndat 3))) (cmd (conc toolpath " -test " run-id "," test-id "&"))) ;(print "Launching " cmd) (system cmd)))))) (hash-table-set! *buttondat* button-key (vector 0 "100 100 100" button-key #f #f)) (vector-set! testvec testnum butn)