Changeset 5eb3f65 for tests/enum_tests
- Timestamp:
- Jun 24, 2024, 11:06:35 PM (6 months ago)
- Branches:
- master
- Children:
- 089b39e1, 6803ff1
- Parents:
- 253d0b4
- Location:
- tests/enum_tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/enum_tests/enumInlineValue.cfa
r253d0b4 r5eb3f65 38 38 // Note: variable name (cat in this case) cannot be overloaded with those declared in enum, 39 39 // Probably for the same reason as const overloading problem 40 // i.e. int identity_t(enum ACD a) would not work as the value E(a) is ambigious currently40 // i.e. int identity_t(enum ACD a) would not work as the value(a) is ambigious currently 41 41 int identity_t(enum ACD cat) { 42 return value E(cat);42 return value(cat); 43 43 } 44 44 … … 47 47 // Because Inline introduce ambiguity on symbols 48 48 sout | "Symbols (enumerator) should have the same values:" |nl; 49 sout | "Symbol a: (10) " | value E(A.a) | "," | valueE(AB.a) | "," | valueE(ACD.a) | nl;50 sout | "Symbol b: (20) " | value E(B.b) | "," | valueE(AB.b) | nl;51 sout | "Symbol ab: (30) " | value E(AB.ab) | nl;52 sout | "Symbol c: (40) " | value E(C.c) | "," | valueE(CD.c) | "," | valueE(ACD.c) | nl;53 sout | "Symbol d: (50) " | value E(D.d) | "," | valueE(CD.d) | "," | valueE(ACD.d) | nl;54 sout | "Symbol cd: (60) " | value E(CD.cd) | "," | valueE(ACD.cd) | nl;55 sout | "Symbol acd: (70) " | value E(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; 56 56 57 57 sout | "Casting/Upcasting:" | nl; 58 sout | "Symbol a: (10) " | value E((A)A.a) | "," | valueE((AB)A.a) | "," | valueE((ACD)A.a) | nl;59 sout | "Symbol b: (20) " | value E((B)B.b) | "," | valueE((AB)B.b) | nl;60 sout | "Symbol ab: (30) " | value E((AB)AB.ab) | nl;61 sout | "Symbol c: (40) " | value E((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) " | value E((D)D.d) | "," | valueE((CD)D.d) | "," | valueE((ACD)D.d) | "," | valueE((ACD)CD.d) | nl;63 sout | "Symbol cd: (60) " | value E((CD)CD.cd) | "," | valueE((ACD)CD.cd) | nl;64 sout | "Symbol acd: (70) " | value E((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; 65 65 66 66 sout | "Function Call:" | nl; -
tests/enum_tests/position.cfa
r253d0b4 r5eb3f65 17 17 Colour c2 = fishy; 18 18 19 sout | "Compile Time: blue value: " | value E(Colour.Blue) | ", position: " | posE(Colour.Blue) | ", label: " | labelE(Colour.Blue) | ", default return value: " | Colour.Blue;20 sout | "Runtime: fishy value: " | value E(fishy) | ", position: " | posE(fishy) | ", label: " | labelE(fishy) | ", default return value: " | fishy;21 sout | "Runtime: C2 value: " | value E(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; 22 22 Colour.Red; 23 23 char * ao = Colour.Red; -
tests/enum_tests/voidEnum.cfa
r253d0b4 r5eb3f65 28 28 sout | b; 29 29 30 sout | labelE(v_1); 31 sout | labelE(v_2); 32 30 sout | label(v_1); 31 sout | label(v_2); 33 32 }
Note: See TracChangeset
for help on using the changeset viewer.