Changeset fca3bf8 for tests


Ignore:
Timestamp:
Feb 18, 2020, 8:52:55 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e326ebca
Parents:
6988dc6 (diff), 3b9c674 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/exceptions
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/except-0.cfa

    r6988dc6 rfca3bf8  
    1919};
    2020
    21 void ?{}(signal_exit * this, const char * area) {
    22         this->area = area;
    23 }
    24 
    25 void ^?{}(signal_exit * this) {
    26         printf("Exiting: %s\n", this->area);
     21void ?{}(signal_exit & this, const char * area) {
     22        this.area = area;
     23}
     24
     25void ^?{}(signal_exit & this) {
     26        printf("Exiting: %s\n", this.area);
    2727//      sout | "Exiting:" | this->area;
    2828}
     
    242242
    243243        // Uncaught termination test.
     244        /* Removed due to non-deterministic output.
    244245        printf("Throw uncaught.\n");
    245246        yang z;
    246247        terminate(&z);
    247 }
     248        */
     249}
  • tests/exceptions/except-2.cfa

    r6988dc6 rfca3bf8  
    1212        struct TABLE(BASE_EXCEPT) const * parent;
    1313        size_t size;
    14         void (*copy)(num_error *this, num_error * other);
    15         void (*free)(num_error *this);
     14        void (*copy)(num_error &this, num_error & other);
     15        void (*free)(num_error &this);
    1616        const char * (*msg)(num_error *this);
    1717        int (*code)(num_error *this);
     
    2828        if ( ! this->msg ) {
    2929                static const char * base = "Num Error with code: X";
    30                 this->msg = malloc(22);
     30                this->msg = (char *)malloc(22);
    3131                for (int i = 0 ; (this->msg[i] = base[i]) ; ++i);
    3232        }
     
    3434        return this->msg;
    3535}
    36 void ?{}(num_error * this, int num) {
    37         this->virtual_table = &INSTANCE(num_error);
    38         this->msg = 0;
    39         this->num = num;
     36void ?{}(num_error & this, int num) {
     37        this.virtual_table = &INSTANCE(num_error);
     38        this.msg = 0;
     39        this.num = num;
    4040}
    41 void ?{}(num_error * this, num_error * other) {
    42         this->virtual_table = other->virtual_table;
    43         this->msg = 0;
    44         this->num = other->num;
     41void ?{}(num_error & this, num_error & other) {
     42        this.virtual_table = other.virtual_table;
     43        this.msg = 0;
     44        this.num = other.num;
    4545}
    46 void ^?{}(num_error * this) {
    47         if( this->msg ) free( this->msg );
     46void ^?{}(num_error & this) {
     47        if( this.msg ) free( this.msg );
    4848}
    4949int num_error_code( num_error * this ) {
Note: See TracChangeset for help on using the changeset viewer.