- Timestamp:
- May 15, 2017, 12:04:49 PM (9 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:
- 9c951e3
- Parents:
- ce8c12f (diff), fae2cf8 (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. - Location:
- src/tests
- Files:
-
- 2 added
- 6 edited
-
.expect/concurrent/sched-int-wait.txt (modified) (1 diff)
-
.expect/gmp.txt (added)
-
.expect/rational.txt (modified) (1 diff)
-
Makefile.am (modified) (2 diffs)
-
Makefile.in (modified) (1 diff)
-
gmp.c (added)
-
rational.c (modified) (3 diffs)
-
sched-int-wait.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/concurrent/sched-int-wait.txt
rce8c12f rd36c117 1 Starting 2 Done -
src/tests/.expect/rational.txt
rce8c12f rd36c117 17 17 3/1 18 18 4/3 19 conversion20 0.7521 0.14285714285714322 3.1415929203539823 3/424 1/725 355/11326 19 decompose 27 20 more tests -
src/tests/Makefile.am
rce8c12f rd36c117 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Thu Feb 16 15:27:50201714 ## Update Count : 4 113 ## Last Modified On : Sun May 14 14:43:48 2017 14 ## Update Count : 42 15 15 ############################################################################### 16 16 … … 90 90 ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 91 91 92 gmp : gmp.c 93 ${CC} ${CFLAGS} -lgmp ${<} -o ${@} 94 92 95 memberCtors-ERR1: memberCtors.c 93 96 ${CC} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/Makefile.in
rce8c12f rd36c117 709 709 ${CC} ${CFLAGS} -CFA -XCFA -p -XCFA -L ${<} -o ${@} 710 710 711 gmp : gmp.c 712 ${CC} ${CFLAGS} -lgmp ${<} -o ${@} 713 711 714 memberCtors-ERR1: memberCtors.c 712 715 ${CC} ${CFLAGS} -DERR1 ${<} -o ${@} -
src/tests/rational.c
rce8c12f rd36c117 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 2 22:11:05201713 // Update Count : 4112 // Last Modified On : Sun May 14 18:10:28 2017 13 // Update Count : 57 14 14 // 15 15 16 #include <rational> 16 17 #include <limits> 17 #include < rational>18 #include <stdlib> 18 19 #include <fstream> 20 21 // UNNECESSARY, FIX ME 22 void ?{}( int * this ) { *this = 0; } 23 void ?{}( int * this, zero_t ) { *this = 0; } 24 void ?{}( int * this, one_t ) { *this = 1; } 19 25 20 26 int main() { 21 27 sout | "constructor" | endl; 22 Rational a = { 3 }, b = { 4 }, c;28 Rational(int) a = { 3 }, b = { 4 }, c; 23 29 sout | a | b | c | endl; 24 a = (Rational){ 4, 8 }; 25 b = (Rational){ 5, 7 }; 30 31 a = (Rational(int)){ 4, 8 }; 32 b = (Rational(int)){ 5, 7 }; 26 33 sout | a | b | endl; 27 a = (Rational ){ -2, -3 };28 b = (Rational ){ 3, -2 };34 a = (Rational(int)){ -2, -3 }; 35 b = (Rational(int)){ 3, -2 }; 29 36 sout | a | b | endl; 30 a = (Rational ){ -2, 3 };31 b = (Rational ){ 3, 2 };37 a = (Rational(int)){ -2, 3 }; 38 b = (Rational(int)){ 3, 2 }; 32 39 sout | a | b | endl; 33 40 34 41 sout | "logical" | endl; 35 a = (Rational ){ -2 };36 b = (Rational ){ -3, 2 };42 a = (Rational(int)){ -2 }; 43 b = (Rational(int)){ -3, 2 }; 37 44 sout | a | b | endl; 38 45 // sout | a == 1 | endl; // FIX ME … … 50 57 sout | a / b | endl; 51 58 52 sout | "conversion" | endl;53 a = (Rational){ 3, 4 };54 sout | widen( a ) | endl;55 a = (Rational){ 1, 7 };56 sout | widen( a ) | endl;57 a = (Rational){ 355, 113 };58 sout | widen( a ) | endl;59 sout | narrow( 0.75, 4 ) | endl;60 sout | narrow( 0.14285714285714, 16 ) | endl;61 sout | narrow( 3.14159265358979, 256 ) | endl;59 // sout | "conversion" | endl; 60 // a = (Rational(int)){ 3, 4 }; 61 // sout | widen( a ) | endl; 62 // a = (Rational(int)){ 1, 7 }; 63 // sout | widen( a ) | endl; 64 // a = (Rational(int)){ 355, 113 }; 65 // sout | widen( a ) | endl; 66 // sout | narrow( 0.75, 4 ) | endl; 67 // sout | narrow( 0.14285714285714, 16 ) | endl; 68 // sout | narrow( 3.14159265358979, 256 ) | endl; 62 69 63 70 sout | "decompose" | endl; 64 RationalImpln, d;71 int n, d; 65 72 // [n, d] = a; 66 73 // sout | a | n | d | endl; 67 74 68 75 sout | "more tests" | endl; 69 Rational x = { 1, 2 }, y = { 2 };76 Rational(int) x = { 1, 2 }, y = { 2 }; 70 77 sout | x - y | endl; 71 78 sout | x > y | endl; … … 73 80 sout | y | denominator( y, -2 ) | y | endl; 74 81 75 Rational z = { 0, 5 };82 Rational(int) z = { 0, 5 }; 76 83 sout | z | endl; 77 84 78 85 sout | x | numerator( x, 0 ) | x | endl; 79 86 80 x = (Rational ){ 1, MAX } + (Rational){ 1, MAX };87 x = (Rational(int)){ 1, MAX } + (Rational(int)){ 1, MAX }; 81 88 sout | x | endl; 82 x = (Rational ){ 3, MAX } + (Rational){ 2, MAX };89 x = (Rational(int)){ 3, MAX } + (Rational(int)){ 2, MAX }; 83 90 sout | x | endl; 84 91 -
src/tests/sched-int-wait.c
rce8c12f rd36c117 113 113 waiter_left = 4; 114 114 processor p; 115 sout | "Starting" | endl; 115 116 { 116 117 Signaler e; … … 122 123 } 123 124 } 125 sout | "Done" | endl; 124 126 }
Note:
See TracChangeset
for help on using the changeset viewer.