Changeset 200fcb3 for tests/sum.cfa


Ignore:
Timestamp:
Dec 12, 2018, 9:16:12 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
5ebb1368
Parents:
3d99498
Message:

add auto newline to sout, change endl to nl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/sum.cfa

    r3d99498 r200fcb3  
    1111// Created On       : Wed May 27 17:56:53 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Nov  6 18:01:10 2018
    14 // Update Count     : 280
     13// Last Modified On : Tue Dec 11 21:50:41 2018
     14// Update Count     : 285
    1515//
    1616
     
    5656        } // for
    5757        sout | "sum from" | low | "to" | High | "is"
    58                  | sum( size, (unsigned char *)a ) | ", check" | (int)s | endl;
     58                 | sum( size, (unsigned char *)a ) | ", check" | (int)s;
    5959
    6060        int s = 0, a[size], v = low;
     
    6464        } // for
    6565        sout | "sum from" | low | "to" | High | "is"
    66                  | sum( size, (int *)a ) | ", check" | (int)s | endl;
     66                 | sum( size, (int *)a ) | ", check" | (int)s;
    6767
    6868        float s = 0.0f, a[size], v = low / 10.0f;
     
    7272        } // for
    7373        sout | "sum from" | low / 10.0f | "to" | High / 10.0f | "is"
    74                  | sum( size, (float *)a ) | ", check" | (float)s | endl;
     74                 | sum( size, (float *)a ) | ", check" | (float)s;
    7575
    7676        double s = 0.0, a[size], v = low / 10.0;
     
    8080        } // for
    8181        sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is"
    82                  | sum( size, (double *)a ) | ", check" | (double)s | endl;
     82                 | sum( size, (double *)a ) | ", check" | (double)s;
    8383
    8484        struct S { int i, j; };
     
    9393        S ?++( S & t ) { S temp = t; t += (S){1}; return temp; }
    9494        ofstream & ?|?( ofstream & os, S v ) { return os | v.i | v.j; }
     95        void ?|?( ofstream & os, S v ) { (ofstream)(os | v); if ( getANL( os ) ) nl( os ); }
    9596
    9697        S s = (S){0}, a[size], v = { low, low };
     
    100101        } // for
    101102        sout | "sum from" | low | "to" | High | "is"
    102                  | sum( size, (S *)a ) | ", check" | (S)s | endl;
     103                 | sum( size, (S *)a ) | ", check" | (S)s;
    103104
    104105        forall( otype Impl | sumable( Impl ) )
     
    114115        } // for
    115116        sout | "sum from" | low | "to" | High | "is"
    116                  | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type
     117                 | sum( size, gs.x ) | ", check" | (int)s;              // add field array in generic type
    117118        delete( gs.x );
    118119} // main
Note: See TracChangeset for help on using the changeset viewer.