Changeset fcc88a4 for src/tests


Ignore:
Timestamp:
Aug 15, 2017, 3:40:39 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
936e9f4
Parents:
3f27b9a
Message:

That got the last case in except-2 working.

Location:
src/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/tests/except-0.c

    r3f27b9a rfcc88a4  
    11// Draft of tests for exception handling.
     2// Outdated: The integer constant exceptions need to be replaced with virtual
     3// exceptions for the new system.
    24
    35// ERROR: exceptions do not interact with ^?{} properly.
  • src/tests/except-1.c

    r3f27b9a rfcc88a4  
    11// Draft memory management test. (remember -fexceptions)
     2// Outdated: The integer constant exceptions need to be replaced with virtual
     3// exceptions for the new system.
    24
    35#include <stdio.h>
  • src/tests/except-2.c

    r3f27b9a rfcc88a4  
    8080}
    8181num_error_vtable _num_error_vtable_instance @= {
    82         &___cfaehm__base_exception_t_vtable_instance,
     82        &INSTANCE(BASE_EXCEPT),
    8383        sizeof(num_error), ?{}, ^?{},
    8484        num_error_msg, num_error_code
     
    9191                yin black;
    9292                throw (BASE_EXCEPT *)&black;
    93         } catch( yin * error ) {
     93        } catch ( yin * error ) {
    9494                printf("throw yin caught.\n");
    9595        }
     
    9999                throwResume (BASE_EXCEPT *)&white;
    100100                printf("> throwResume returned.\n");
    101         } catchResume( yang * error ) {
     101        } catchResume ( yang * error ) {
    102102                printf("throwResume yang caught <");
    103103        }
    104104
    105         /* Conditional catches are still a work in progress.
    106105        try {
    107106                num_error x = { 2 };
    108                 throw (struct exception_t *)&x;
     107                throw (BASE_EXCEPT *)&x;
    109108        }
    110         catch (num_error * error0 ; 3 == error0->virtual_table->code( error0 ) ) {
    111                 printf("exception at %p\n", error0 );
     109        catch (num_error * error ; 3 == error->virtual_table->code( error ) ) {
     110                printf("exception at %p\n", error );
    112111                printf("Should not be printed.\n");
    113112        }
    114         catch (num_error * error1 ; 2 == error1->virtual_table->code( error1 ) ) {
     113        catch (num_error * error ; 2 == error->virtual_table->code( error ) ) {
    115114                printf("Should be printed.\n");
    116         }*/
     115        }
    117116}
    118117
Note: See TracChangeset for help on using the changeset viewer.