Changeset 9b140bd for tests


Ignore:
Timestamp:
May 7, 2024, 9:03:20 PM (7 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
983f486
Parents:
6d9aa79
Message:

Update the test file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/enum_tests/voidEnum.cfa

    r6d9aa79 r9b140bd  
    11#include <fstream.hfa>
    2 
     2#include <enum.hfa>
    33enum() voidEnum {
    44    a, b, c
     
    99};
    1010
    11 // void foo (const enum voidEnum & t){}
     11char* a[voidEnum] = {
     12    "A",
     13    "B",
     14    "C"
     15};
    1216
    1317int main() {
    1418    enum voidEnum v_1 = a;
    1519    enum voidEnum v_2 = b;
    16     // foo(b);
    17     // enum voidEnum v_3 = 10;
    18     // Error as int cannot convert to void enum
     20    sout | "Two different Opague Enum Should not be the same:";
    1921    if ( v_1 == v_2 ) {
    20         sout | "Equal" | nl;
     22        sout | "a and b are Equal" | nl;
    2123    } else {
    22         sout | "Not Equal" | nl;
     24        sout | "a and b are Not Equal" | nl;
    2325    }
    24     sout | a | nl;
    25     sout | b | nl;
     26    sout | "Default Output:";
     27    sout | a;
     28    sout | b;
     29   
     30    sout | labelE(v_1);
     31    sout | labelE(v_2);
     32
    2633}
Note: See TracChangeset for help on using the changeset viewer.