Changeset 5eb3f65 for tests/enum_tests


Ignore:
Timestamp:
Jun 24, 2024, 11:06:35 PM (6 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
089b39e1, 6803ff1
Parents:
253d0b4
Message:

change enumeration function names labelE, valueE, posE to label, value, posn

Location:
tests/enum_tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tests/enum_tests/enumInlineValue.cfa

    r253d0b4 r5eb3f65  
    3838// Note: variable name (cat in this case) cannot be overloaded with those declared in enum,
    3939// Probably for the same reason as const overloading problem
    40 // i.e. int identity_t(enum ACD a) would not work as the valueE(a) is ambigious currently
     40// i.e. int identity_t(enum ACD a) would not work as the value(a) is ambigious currently
    4141int identity_t(enum ACD cat) {
    42     return valueE(cat);
     42    return value(cat);
    4343}
    4444
     
    4747    // Because Inline introduce ambiguity on symbols
    4848    sout | "Symbols (enumerator) should have the same values:" |nl;
    49     sout | "Symbol a: (10) " | valueE(A.a) | "," | valueE(AB.a) | "," | valueE(ACD.a) | nl;
    50     sout | "Symbol b: (20) " | valueE(B.b) | "," | valueE(AB.b) | nl;
    51     sout | "Symbol ab: (30) " | valueE(AB.ab) | nl;
    52     sout | "Symbol c: (40) " | valueE(C.c) | "," | valueE(CD.c) | "," | valueE(ACD.c) | nl;
    53     sout | "Symbol d: (50) " | valueE(D.d) | "," | valueE(CD.d) | "," | valueE(ACD.d) | nl;
    54     sout | "Symbol cd: (60) " | valueE(CD.cd) | "," | valueE(ACD.cd) | nl;
    55     sout | "Symbol acd: (70) " | valueE(ACD.acd) | nl;
     49    sout | "Symbol a: (10) " | value(A.a) | "," | value(AB.a) | "," | value(ACD.a) | nl;
     50    sout | "Symbol b: (20) " | value(B.b) | "," | value(AB.b) | nl;
     51    sout | "Symbol ab: (30) " | value(AB.ab) | nl;
     52    sout | "Symbol c: (40) " | value(C.c) | "," | value(CD.c) | "," | value(ACD.c) | nl;
     53    sout | "Symbol d: (50) " | value(D.d) | "," | value(CD.d) | "," | value(ACD.d) | nl;
     54    sout | "Symbol cd: (60) " | value(CD.cd) | "," | value(ACD.cd) | nl;
     55    sout | "Symbol acd: (70) " | value(ACD.acd) | nl;
    5656
    5757    sout | "Casting/Upcasting:" | nl;
    58     sout | "Symbol a: (10) " | valueE((A)A.a) | "," | valueE((AB)A.a) | "," | valueE((ACD)A.a) | nl;
    59     sout | "Symbol b: (20) " | valueE((B)B.b) | "," | valueE((AB)B.b) | nl;
    60     sout | "Symbol ab: (30) " | valueE((AB)AB.ab) | nl;
    61     sout | "Symbol c: (40) " | valueE((C)C.c) | "," | valueE((CD)C.c) | "," | valueE((ACD)C.c) | "," | valueE((CD)CD.c)| "," | valueE((ACD)CD.c) | nl;
    62     sout | "Symbol d: (50) " | valueE((D)D.d) | "," | valueE((CD)D.d) | "," | valueE((ACD)D.d) | "," | valueE((ACD)CD.d) | nl;
    63     sout | "Symbol cd: (60) " | valueE((CD)CD.cd) | "," | valueE((ACD)CD.cd) | nl;
    64     sout | "Symbol acd: (70) " | valueE((ACD)ACD.acd) | nl;
     58    sout | "Symbol a: (10) " | value((A)A.a) | "," | value((AB)A.a) | "," | value((ACD)A.a) | nl;
     59    sout | "Symbol b: (20) " | value((B)B.b) | "," | value((AB)B.b) | nl;
     60    sout | "Symbol ab: (30) " | value((AB)AB.ab) | nl;
     61    sout | "Symbol c: (40) " | value((C)C.c) | "," | value((CD)C.c) | "," | value((ACD)C.c) | "," | value((CD)CD.c)| "," | value((ACD)CD.c) | nl;
     62    sout | "Symbol d: (50) " | value((D)D.d) | "," | value((CD)D.d) | "," | value((ACD)D.d) | "," | value((ACD)CD.d) | nl;
     63    sout | "Symbol cd: (60) " | value((CD)CD.cd) | "," | value((ACD)CD.cd) | nl;
     64    sout | "Symbol acd: (70) " | value((ACD)ACD.acd) | nl;
    6565
    6666    sout | "Function Call:" | nl;
  • tests/enum_tests/position.cfa

    r253d0b4 r5eb3f65  
    1717    Colour c2 = fishy;
    1818
    19     sout | "Compile Time: blue value: " | valueE(Colour.Blue) | ", position: " | posE(Colour.Blue) | ", label: " | labelE(Colour.Blue) | ", default return value: " | Colour.Blue;
    20     sout | "Runtime: fishy value: " | valueE(fishy) | ", position: " | posE(fishy) | ", label: " | labelE(fishy) | ", default return value: " | fishy;
    21     sout | "Runtime: C2 value: " | valueE(c2) | ", position: " | posE(c2) | ", label: " | labelE(c2) | ", default return value: " | c2;
     19    sout | "Compile Time: blue value: " | value(Colour.Blue) | ", position: " | posn(Colour.Blue) | ", label: " | label(Colour.Blue) | ", default return value: " | Colour.Blue;
     20    sout | "Runtime: fishy value: " | value(fishy) | ", position: " | posn(fishy) | ", label: " | label(fishy) | ", default return value: " | fishy;
     21    sout | "Runtime: C2 value: " | value(c2) | ", position: " | posn(c2) | ", label: " | label(c2) | ", default return value: " | c2;
    2222    Colour.Red;
    2323    char * ao = Colour.Red;
  • tests/enum_tests/voidEnum.cfa

    r253d0b4 r5eb3f65  
    2828    sout | b;
    2929   
    30     sout | labelE(v_1);
    31     sout | labelE(v_2);
    32 
     30    sout | label(v_1);
     31    sout | label(v_2);
    3332}
Note: See TracChangeset for help on using the changeset viewer.