Changeset 5b51f5e for src/tests/random.c
- Timestamp:
- Jan 5, 2018, 3:21:42 PM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/random.c
r5c4f2c2 r5b51f5e 10 10 // Created On : Tue Jul 5 21:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Oct 30 23:06:49 201713 // Update Count : 612 // Last Modified On : Tue Jan 2 12:19:34 2018 13 // Update Count : 19 14 14 // 15 15 … … 19 19 20 20 int main() { 21 // srandom( getpid() ); // set random seed22 random_seed( 1003 );// fixed seed for repeatable tests21 // srandom( getpid() ); // set random seed 22 srandom( 1003 ); // fixed seed for repeatable tests 23 23 24 24 // test polymorphic calls to random and stream 25 25 char c = random(); 26 26 sout | c | endl; 27 c = random( 'A' ); 28 sout | c | endl; 29 c = random( 'A', 'Z' ); 30 sout | c | endl; 31 27 32 int i = random(); 28 33 sout | i | endl; 34 i = random( 10 ); 35 sout | i | endl; 36 i = random( -10, 20 ); 37 sout | i | endl; 38 29 39 unsigned int ui = random(); 30 40 sout | ui | endl; 41 ui = random( 10u ); 42 sout | ui | endl; 43 ui = random( 10u, 20u ); 44 sout | ui | endl; 45 31 46 long int li = random(); 32 47 sout | li | endl; 48 li = random( 10l ); 49 sout | li | endl; 50 li = random( -10l, 20l ); 51 sout | li | endl; 52 33 53 unsigned long int uli = random(); 34 54 sout | uli | endl; 55 uli = random( 10ul ); 56 sout | uli | endl; 57 uli = random( 10ul, 20ul ); 58 sout | uli | endl; 59 35 60 float f = random(); 36 61 sout | f | endl; 62 37 63 double d = random(); 38 64 sout | d | endl; 65 39 66 float _Complex fc = random(); 40 67 sout | fc | endl; 68 41 69 double _Complex dc = random(); 42 70 sout | dc | endl; 71 43 72 long double _Complex ldc = random(); 44 73 sout | ldc | endl;
Note:
See TracChangeset
for help on using the changeset viewer.