Changeset 5b51f5e for src/tests/random.c


Ignore:
Timestamp:
Jan 5, 2018, 3:21:42 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
65deb18, cae28da
Parents:
5c4f2c2 (diff), b834e98 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/random.c

    r5c4f2c2 r5b51f5e  
    1010// Created On       : Tue Jul  5 21:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Oct 30 23:06:49 2017
    13 // Update Count     : 6
     12// Last Modified On : Tue Jan  2 12:19:34 2018
     13// Update Count     : 19
    1414//
    1515
     
    1919
    2020int main() {
    21         //srandom( getpid() );                                                          // set random seed
    22         random_seed( 1003 );                                                            // fixed seed for repeatable tests
     21        // srandom( getpid() );                                                         // set random seed
     22        srandom( 1003 );                                                                        // fixed seed for repeatable tests
    2323
    2424        // test polymorphic calls to random and stream
    2525        char c = random();
    2626        sout | c | endl;
     27        c = random( 'A' );
     28        sout | c | endl;
     29        c = random( 'A', 'Z' );
     30        sout | c | endl;
     31
    2732        int i = random();
    2833    sout | i | endl;
     34        i = random( 10 );
     35    sout | i | endl;
     36        i = random( -10, 20 );
     37    sout | i | endl;
     38
    2939        unsigned int ui = random();
    3040    sout | ui | endl;
     41        ui = random( 10u );
     42    sout | ui | endl;
     43        ui = random( 10u, 20u );
     44    sout | ui | endl;
     45
    3146        long int li = random();
    3247    sout | li | endl;
     48        li = random( 10l );
     49    sout | li | endl;
     50        li = random( -10l, 20l );
     51    sout | li | endl;
     52
    3353        unsigned long int uli = random();
    3454    sout | uli | endl;
     55        uli = random( 10ul );
     56    sout | uli | endl;
     57        uli = random( 10ul, 20ul );
     58    sout | uli | endl;
     59
    3560    float f = random();
    3661    sout | f | endl;
     62
    3763    double d = random();
    3864    sout | d | endl;
     65
    3966    float _Complex fc = random();
    4067    sout | fc | endl;
     68
    4169    double _Complex dc = random();
    4270    sout | dc | endl;
     71
    4372    long double _Complex ldc = random();
    4473    sout | ldc | endl;
Note: See TracChangeset for help on using the changeset viewer.