Menu

#2253 Error break in rtest2 with display_all=true

closed
nobody
Lisp Core (457)
3
2011-08-14
2011-08-12
No

In 2D-display and with display_all=true we have an error break in the test file rtest2.mac for problem 55.

(%i1) run_testsuite(display_all=true, tests=[rtest2]);
Running tests in rtest2:

[...]

********************** Problem 55 ***************
Input:

Caused an error break: rtest2

Error summary:
Error found in rtest2, problem:
(error break)
0 tests failed out of 0 total tests.

This is the example 55 which fails. The error break occurs only if the flag display_all is set to true.

/* should trigger an error */
errcatch (matrix ([1], [1, 2]));
[];

The reason is, that in a test mode an unsimplified expression is displayed. But in this case it is a bad formed unsimplified expression. The matrix is not well formed. The wrong matrix causes an error break in the function dimension-$matrix.

The problem has been introduced in displa.lisp with revision 15.03.2011. The check for an unsimplified matrix has been cut out by me. This has been done, because the linear display of an unsimplified matrix has been considered as a bug in ID: 635708- Bad display of unsimplified expr.

A possible correction is to check more careful, if we have a valid matrix in dim-$matrix. The following code allows the display of bad formed matrices without an error break. The code has been extended with a check for a equal number of columns.

(defun dim-$matrix (form result)
(prog (dmstr rstr cstr consp cols)
(setq cols (if ($listp (cadr form)) (length (cadr form)) 0))
(if (or (null (cdr form))
(memalike '((mlist simp)) (cdr form))
;; Check if the matrix has lists as rows with a equal number of
;; columns.
(dolist (row (cdr form))
(if (or (not ($listp row))
(not (eql cols (length row))))
(return t))))
;; The matrix is not well formed. Display the matrix in linear mode.
(return (dimension-function form result)))
[...]

Dieter Kaiser

Discussion

  • Dieter Kaiser

    Dieter Kaiser - 2011-08-14

    Fixed in displa.lisp revision 14.08.2011.
    Closing this bug report as fixed.
    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2011-08-14
    • status: open --> closed
     

Log in to post a comment.