Ignore:
Timestamp:
Jan 9, 2025, 11:44:59 AM (11 days ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
329c62f
Parents:
550446f
Message:

Added more custom constructors into the new exceptions test to avoid errors on some machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/message.cfa

    r550446f r5a894e12  
    4242}
    4343
     44// Do not construct an exception without a vtable!
     45void ?{}(BadIndexException&) = void;
     46
     47void ?{}(BadIndexException & this,
     48                vtable(BadIndexException) & vt, int value, int size) {
     49        this.virtual_table = &vt;
     50        this.value = value;
     51        this.size = size;
     52        this.message = 0p;
     53}
     54
     55void ?{}(BadIndexException & this, BadIndexException that) {
     56        copy(&this, &that);
     57}
     58
    4459void ^?{}(BadIndexException & this) {
    4560        free(this.message);
     
    5469// This is not supposed to be a real range check, but that's the idea:
    5570void failRangeCheck(int index, int size) {
    56         throw (BadIndexException){ &arrayIndex, index, size };
     71        throw (BadIndexException){ arrayIndex, index, size };
    5772}
    5873
Note: See TracChangeset for help on using the changeset viewer.