Changeset 2444324


Ignore:
Timestamp:
Dec 3, 2019, 10:06:40 PM (2 years ago)
Author:
Dmitry Kobets <dkobets@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
3376ec9
Parents:
d131480
Message:

Add tests for vec2 int

Location:
tests/vector
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • tests/vector/.expect/vec2_int.txt

    rd131480 r2444324  
    1 ctor(x,y):<1.,2.>
    2 copy ctor:<1.,2.>
    3 assignment:<3.,4.2>
    4 move assignment:<1.,2.>
    5 zero-init:<0.,0.>
    6 zero-assign:<0.,0.>
    7 fill-ctor:<1.23,1.23>
    8 ?-?:<2,43>
    9 ?-=?:<125,-657>
    10 -?:<-125,657>
    11 ?+?:<23,245>
    12 ?+=?:<23,245>
     1ctor(x,y):<1,2>
     2copy ctor:<1,2>
     3assignment:<3,4>
     4move assignment:<1,2>
     5zero-init:<0,0>
     6zero-assign:<0,0>
     7fill-ctor:<123,123>
     8?-?:<-1002,17>
     9?-=?:<-1002,17>
     10-?:<1002,-17>
     11?+?:<1004,-11>
     12?+=?:<1004,-11>
    1313v*s:<45,825>
    1414s*v:<45,825>
    1515?*=?:<45,825>
    16 ?/?:<0,-3>
    17 ?/=?:<0,-3>
    18 limits:<2147483647,-2147483648>
     16?/?:<7,-3>
     17?/=?:<7,-3>
    1918dot_1:0
    2019dot_2:32
    21 length:5
    2220length_squared:25
    23 distance:9
    24 normalize:<0,0>
    25 normalize_2:<1,0>
    26 project:<5,0>
    27 project_2:<5.5,5.5>
    28 reflect:<-5.,6.>
    29 refract:<5.,6.>
    30 refract:<3.7594,4.5592>
    31 faceforward_nochange:<4.,5.5>
    32 faceforward_flip:<-4.,-5.5>
     21faceforward_nochange:<4,5>
     22faceforward_flip:<-4,-5>
  • tests/vector/vec2_int.cfa

    rd131480 r2444324  
    1010    sout | "copy ctor:" | v2;
    1111
    12     v2 = (vec2(int)){3, 42};
     12    v2 = (vec2(int)){3, 4};
    1313    sout | "assignment:" | v2;
    1414
     
    2222    sout | "zero-assign:" | v1;
    2323
    24     vec2(int) v4 = {100};
     24    vec2(int) v4 = {123};
    2525    sout | "fill-ctor:" | v4;
    2626
    27     v1 = (vec2(int)){123, 343};
    28     sout | "?-?:" | (v1 - (vec2(int)){121,300});
     27    v1 = (vec2(int)){1, 3};
     28    sout | "?-?:" | (v1 - (vec2(int)){1003, -14});
    2929
    30     v1 -= (vec2(int)){-2, 1000};
     30    v1 -= (vec2(int)){1003, -14};
    3131    sout | "?-=?:" | v1;
    3232
     
    3434    sout | "-?:" | v1;
    3535
    36     v1 = (vec2(int)){15, 275};
    37     sout | "?+?:" | (v1 + (vec2(int)){8, -30});
     36    v1 = (vec2(int)){1, 3};
     37    sout | "?+?:" | (v1 + (vec2(int)){1003, -14});
    3838
    39     v1 += (vec2(int)){8, -30};
     39    v1 += (vec2(int)){1003, -14};
    4040    sout | "?+=?:" | v1;
    4141
     
    4848    sout | "?*=?:" | v1;
    4949
    50     v1 = (vec2(int)){2, -10};
     50    v1 = (vec2(int)){21, -10};
    5151    sout | "?/?:" | (v1 / 3);
    5252
    5353    v1 /= 3;
    5454    sout | "?/=?:" | v1;
    55 
    56     v1 = (vec2(int)){MAX, MIN};
    57     sout | "limits:" | v1;
    5855
    5956    v1 = (vec2(int)){2, 3};
     
    6562
    6663    v1 = (vec2(int)){4, 3};
    67     sout | "length:" | length(v1);
    68 
    6964    sout | "length_squared:" | length_squared(v1);
    7065
    71     v2 = (vec2(int)){6, 12};
    72     sout | "distance:" | distance(v1, v2);
    73 
    74     sout | "normalize:" | normalize(v2);
    75     sout | "normalize_2:" | normalize((vec2(int)){20,0});
    76 
    77     sout | "project:" | project((vec2(int)){5,6}, (vec2(int)){1, 0});
    78     sout | "project_2:" | project((vec2(int)){5,6}, (vec2(int)){1, 1});
    79 
    80     v1 = (vec2(int)){5,6};
    81     v2 = (vec2(int)){1,0};
    82     sout | "reflect:" | reflect(v1,v2);
    83 
    84     v2 = (vec2(int)){0,-1};
    85     sout | "refract:" | refract(v1,v2,1);
    86     sout | "refract:" | refract(v1,v2,1/1.33f);
    87 
    8866    vec2(int) geometric_normal = {5,6};
    89     vec2(int) perturbed_normal = {4,5.5};
    90     vec2(int) eyeline = {-1,0.002};
     67    vec2(int) perturbed_normal = {4,5};
     68    vec2(int) eyeline = {-1,0};
    9169    sout | "faceforward_nochange:" | faceforward(perturbed_normal, eyeline, geometric_normal);
    9270
    93     eyeline = (vec2(int)){1,0.002};
     71    eyeline = (vec2(int)){1,0};
    9472    sout | "faceforward_flip:" | faceforward(perturbed_normal, eyeline, geometric_normal);
    9573}
Note: See TracChangeset for help on using the changeset viewer.