Commit graph

7 commits

Author SHA1 Message Date
Douglas Katzman dd911e0079 Use INVOKE-RESTART, not EXIT, to bail out of test files 2022-06-02 13:31:22 -04:00
Jan Moringen 957c84657f tests: use CHECKED-COMPILE-AND-ASSERT in clos-typechecking.impure.lisp
* More readable and covers multiple optimization policies

* Uncovered two problems with constructors and slot type checking:

  1. TYPE-WARNINGs can be signaled when entries are added to the
     constructor cache, i.e. at runtime instead of compile-time

  2. Slot type checking in constructors only happens when SAFETY is 3
     which is different from SLOT-VALUE and writer functions for which
     type checking is enabled when SAFETY > SPEED(?)

* Define classes and methods for tests at toplevel to avoid a bunch of
  warnings
2017-12-10 14:51:34 +01:00
Douglas Katzman 278038f2bb Adjust test files for interpreted code.
The following categories of tests are not expected behaviors,
or would be "nice to have but can't" in the interpreter:
- explicitly unsafe code to explore edge cases
- inlining, use of compiler-macros
- non-consing (especially dx allocation)

A few places that appeared to assume that EVAL meant "compile"
are changed to call COMPILE.

The test driver will cons :INTERPRETER onto *FEATURES* around
each test file when actually interpreting, so that tests can
use :SKIPPED-ON instead of testing SB-EXT:*EVALUATOR-MODE*.

After this, an almost-fully-passing run of tests is possible
in the new interpreter; not nearly so in sb-eval though.
2015-10-19 08:36:28 -04:00
Stas Boukarev 4e4d7e4108 Replace (assert (raises-error? ...)) with assert-error. 2014-05-29 18:15:34 +04:00
Nikodemus Siivola 963d8df14d 1.0.23.36: typecheck :ALLOCATION :CLASS slot initforms in safe code
* Initforms for shared slots are not applied at make-instance, but at
   class definition time. (See CLHS 4.3.6 and 7.1.) Reported by Didier
   Verna.
2008-12-12 10:57:52 +00:00
Nikodemus Siivola b7de68f093 1.0.10.45: save typecheck-function in slot-table even if location is not saved
* Otherwise non-standard metaclasses for which optimized instance
   accessors can be used don't get the typecheck-fun from the wrapper
   in the function returned from MAKE-OPTIMIZED-STD-WRITER-FUNCTION.

 * Test-case.

 * Missing NEWS entry for .44.
2007-10-11 15:33:55 +00:00
Juho Snellman 4f8f4b25cb 0.9.18.38:
Typechecking for CLOS instance slots, based on the earlier
        clos-typechecking branch by Christophe Rhodes.

        To get the typechecking right, especially when considering
        inheritance where the slots in subclasses can have tighter
        :TYPEs than in the superclass, some major PCL optimizations
        need to be disabled. This slows down slot writes significantly.
        Typechecking is thus only enabled for safe code.

        * Store a function in each slot-definition with a non-T :TYPE, which
          checks whether its parameter is of the proper type for the slot.
        * Store in each class knowledge about whether the class was defined
          in an environment with (SAFETY 3) policy.
        * Don't do PV optimization for SETF of SLOT-VALUE in safe code.
        * When generating writer methods for classes defined in safe code,
          fetch the appropriate slotd for the instance and call its
          type-checking-function (if one exists) before doing the slot write.
        * Do the same in the slow path of SET-SLOT-VALUE
        * When generating a ctor for a MAKE-INSTANCE call in safe code,
          check the types of the supplied initargs.
        * Fix declaration handling for some binding forms in SB-WALK
        * Remove dead accessor-call optimization code
        * Tests
2006-11-07 10:22:09 +00:00