home *** CD-ROM | disk | FTP | other *** search
- *** 1.7 1992/12/28 07:31:22
- --- PatchLev.h 1993/07/13 20:01:40
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "9"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,5 ----
-
- ! #define PatchLevel "10"
-
- /*
- * the Patch Level above is to identify the version
- *** 1.4 1992/12/28 07:31:22
- --- expected.out 1993/07/13 20:01:41
- ***************
- *** 134,139 ****
- --- 134,140 ----
- one = 1
- one + 1 = 2
- two = 2
- + twofiftysix = 256
- fact30 = factorial(30) = 265252859812191058636308480000000
- fact28 = factorial(28) = 304888344611713860501504000000
- fact30 + fact28 = 265557748156802772496809984000000
- ***************
- *** 171,180 ****
- --- 172,185 ----
- comps64 ^ s32 = 18446744069414584319
-
- enter an Integer: number = 12345678901234567890
- + 2^32 = 4294967296
- + 2^32 % (2^32-1) = 1
- + 2^32 % (2^32-1) = 1
-
- End of test
- trationa
- one = 1
- + two = 2
- third = 1/3
- half = 1/2
- third + half = 5/6
- ***************
- *** 446,452 ****
- five samples:
- 10.4918 0.295112 0.184577 2.14799 0.10053
- Statistics for 100 samples:
- ! samples: 100 min: 2.36481e-04 max: 15.4934
- mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
- SampleHistogram for 100 Normal samples
- < -4 : 0
- --- 451,457 ----
- five samples:
- 10.4918 0.295112 0.184577 2.14799 0.10053
- Statistics for 100 samples:
- ! samples: 100 min: 0.000236481 max: 15.4934
- mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
- SampleHistogram for 100 Normal samples
- < -4 : 0
- ***************
- *** 454,460 ****
- < -2.4 : 0
- < -1.6 : 7
- < -0.8 : 15
- ! < 6.66134e-16 : 36
- < 0.8 : 15
- < 1.6 : 19
- < 2.4 : 7
- --- 459,465 ----
- < -2.4 : 0
- < -1.6 : 7
- < -0.8 : 15
- ! < -2.22045e-16 : 36
- < 0.8 : 15
- < 1.6 : 19
- < 2.4 : 7
- ***************
- *** 647,652 ****
- --- 652,658 ----
- 1.1 = 1
- .7 + .5 = -0.8
- -.5 - .7 = 0.8
- + tillist
- prepending...
- a: 9 8 7 6 5 4 3 2 1 0
- appending...
- *** 1.4 1992/12/28 07:31:22
- --- makefile.32 1993/07/13 20:01:41
- ***************
- *** 42,50 ****
- --- 42,54 ----
- tfix24.ttp tgetopt.ttp tinteger.ttp tobstack.ttp trandom.ttp trationa.ttp \
- tstring.ttp tillist.ttp
-
- + OBJS = $(TEST:.ttp=.o)
- # the stuff to make
- ALL= $(TEST)
-
- + objects: $(OBJS)
- + obj: $(OBJS)
- +
- # g++ files should have extension .cc
- # generated test files will habe .ttp extn
-
- *** 1.1 1992/03/22 21:15:45
- --- tbitset.cc 1993/07/13 20:01:41
- ***************
- *** 51,57 ****
- assert(x.OK());
- }
-
- ! main()
- {
- cout << "BitSet tests:\n";
-
- --- 51,57 ----
- assert(x.OK());
- }
-
- ! int main()
- {
- cout << "BitSet tests:\n";
-
- ***************
- *** 184,190 ****
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- ! for (p = g.last(0); p >= 0; p = g.previous(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- --- 184,190 ----
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- ! for (p = g.last(0); p >= 0; p = g.prev(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- ***************
- *** 201,205 ****
- --- 201,206 ----
- assert(h.OK());
-
- cout << "\nEnd of test.\n";
- + return 0;
- }
-
- *** 1.1 1992/03/22 21:15:45
- --- tbitstri.cc 1993/07/13 20:01:42
- ***************
- *** 177,183 ****
- cout << "k.right_trim(1) : " << k << "\n";
- }
-
- ! main()
- {
- BitString a;
- BitString b = atoBitString("1000000001");
- --- 177,183 ----
- cout << "k.right_trim(1) : " << k << "\n";
- }
-
- ! int main()
- {
- BitString a;
- BitString b = atoBitString("1000000001");
- ***************
- *** 234,240 ****
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- ! for (p = g.last(0); p >= 0; p = g.previous(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- --- 234,240 ----
- cout << "\n";
-
- cout << "clear bits in g (reverse order):\n";
- ! for (p = g.last(0); p >= 0; p = g.prev(p, 0))
- {
- assert(g[p] == 0);
- cout << p << " ";
- ***************
- *** 317,323 ****
- subtest(d);
-
- cout << "\nEnd of test.\n";
- !
- }
-
-
- --- 317,323 ----
- subtest(d);
-
- cout << "\nEnd of test.\n";
- ! return 0;
- }
-
-
- *** 1.1 1992/03/22 21:15:45
- --- tcomplex.cc 1993/07/13 20:01:42
- ***************
- *** 129,132 ****
- --- 129,133 ----
- cout << "number = " << c << "\n";
-
- cout << "\nEnd of test\n";
- + return 0;
- }
- *** 1.1 1992/03/22 21:15:45
- --- tfile.cc 1993/07/13 20:01:43
- ***************
- *** 83,88 ****
- --- 83,89 ----
- cout << "rest = " << s << "\n";
-
- assert(cin.good());
- +
- assert(cout.good());
-
- }
- ***************
- *** 367,370 ****
- --- 368,372 ----
- cout << "cerr: " << "(stderr)" << "\t" << cerr.rdstate() << "\n";
- #endif
- cout << "\nend of test.\n";
- + return 0;
- }
- *** 1.1 1992/03/22 21:15:45
- --- tfile.inp 1993/07/13 20:01:43
- ***************
- *** 2,4 ****
- --- 2,5 ----
- 123 4567 89012
- 123.456 -1.2e-2
- 1 2 3 4 5
- + abcdefghijklmnop
- *** 1.1 1992/03/22 21:15:45
- --- tfix.cc 1993/07/13 20:01:43
- ***************
- *** 4,35 ****
-
- #include <xfix.h>
-
- ! overload check;
- ! overload checkb;
-
- ! void check(const char* x, Fix y)
- ! {
- ! cout << x << " = " << (y) << "\n";
- ! }
-
- ! void check(const char* x, int y)
- ! {
- ! cout << x << " = " << (y) << "\n";
- ! }
-
- ! void check(const char* x, double y)
- ! {
- ! cout << x << " = " << (y) << "\n";
- ! }
-
- ! void checkb(const char* x, Fix y)
- {
- cout << x << " = " << (y) << " [" << length(y) << "]"<< "\n";
- }
-
-
-
- ! main() {
- cout << "Fix: identities should be displayed\n"
- << "[X] displays the precision of a given value\n"
- << "[*] indicates that the full precision is not used for coding reasons\n";
- --- 4,25 ----
-
- #include <xfix.h>
-
- ! void check(const char* x, Fix y) { cout << x << " = " << (y) << "\n"; }
-
- ! void check(const char* x, int y) { cout << x << " = " << (y) << "\n"; }
-
- ! void check(const char* x, long y) { cout << x << " = " << (y) << "\n"; }
-
- ! void check(const char* x, double y) { cout << x << " = " << (y) << "\n"; }
-
- ! void checkb(const char* x, const Fix y)
- {
- cout << x << " = " << (y) << " [" << length(y) << "]"<< "\n";
- }
-
-
-
- ! int main() {
- cout << "Fix: identities should be displayed\n"
- << "[X] displays the precision of a given value\n"
- << "[*] indicates that the full precision is not used for coding reasons\n";
- ***************
- *** 55,61 ****
- check(".1 [33] <= -.2 [17]",d <= c);
-
- e = .5;
- ! check("1073741824",mantissa(e));
- check(".5",value(e));
-
- checkb(".5 [17]",+e);
- --- 45,51 ----
- check(".1 [33] <= -.2 [17]",d <= c);
-
- e = .5;
- ! check("1073741824",mantissa(e).as_double());
- check(".5",value(e));
-
- checkb(".5 [17]",+e);
- ***************
- *** 106,109 ****
- --- 96,101 ----
- checkb(".95 [16] + .1 [33]",g+d);
- checkb("-.1 [33] - .95 [16]",-d-g);
- checkb(".5 [17] * 2",e*2);
- +
- + return 0;
- }
- *** 1.1 1992/03/22 21:15:45
- --- tfix16.cc 1993/07/13 20:01:43
- ***************
- *** 8,13 ****
- --- 8,14 ----
- // of evaluating y to happen before x is printed.
-
- inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
- + inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, Fix16 y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, Fix32 y) { cout << x << " = " << (y) << "\n"; }
- ***************
- *** 102,109 ****
- check(".5 / .1",b/d);
- }
-
- ! main() {
- test16();
- test32();
- }
- -
- --- 103,110 ----
- check(".5 / .1",b/d);
- }
-
- ! int main() {
- test16();
- test32();
- + return 0;
- }
- *** 1.1 1992/03/22 21:15:45
- --- tfix24.cc 1993/07/13 20:01:44
- ***************
- *** 8,13 ****
- --- 8,15 ----
- // of evaluating y to happen before x is printed.
-
- inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
- + inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
- + inline void check(char *x, unsigned long y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, Fix24 y) { cout << x << " = " << (y) << "\n"; }
- inline void check(char *x, Fix48 y) { cout << x << " = " << (y) << "\n"; }
- ***************
- *** 102,109 ****
- check("-.5 - .7",c-g);
- }
-
- ! main() {
- test24();
- test48();
- }
-
- --- 104,112 ----
- check("-.5 - .7",c-g);
- }
-
- ! int main() {
- test24();
- test48();
- + return 0;
- }
-
- *** 1.1 1992/12/28 07:31:22
- --- tillist.cc 1993/07/13 20:01:44
- ***************
- *** 19,25 ****
- #define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
- ! #include <stream.h>
- #include <xsllist.h>
- #include <xdllist.h>
-
- --- 19,25 ----
- #define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
- else _assert(#ex, __FILE__,__LINE__); }
-
- ! #include <iostream.h>
- #include <xsllist.h>
- #include <xdllist.h>
-
- *** 1.2 1992/12/28 07:31:22
- --- tinteger.cc 1993/07/13 20:01:45
- ***************
- *** 393,399 ****
- cout << "2^32 % (2^32-1) = " << b << "\n"; // but b is ok
- }
-
- ! main()
- {
- Integer one = 1;
- cout << "one = " << one << "\n";
- --- 393,399 ----
- cout << "2^32 % (2^32-1) = " << b << "\n"; // but b is ok
- }
-
- ! int main()
- {
- Integer one = 1;
- cout << "one = " << one << "\n";
- ***************
- *** 406,411 ****
- --- 406,417 ----
- assert(two.OK());
- assert(two == 2);
-
- + /* inbox/1782 */
- + Integer n (0);
- + setbit (n, 8);
- + clearbit (n, 16);
- + cout << "twofiftysix = " << n << '\n';
- +
- facttest(one, two);
- fibtest();
- anothertest();
- ***************
- *** 413,416 ****
- --- 419,423 ----
- modtest();
-
- cout << "\nEnd of test\n";
- + return 0;
- }
- *** 1.2 1992/12/28 07:31:22
- --- tobstack.cc 1993/07/13 20:01:45
- ***************
- *** 17,22 ****
- --- 17,23 ----
- #include <stddef.h>
- #include <ctype.h>
-
- + int
- main()
- {
- char* s[10000];
- ***************
- *** 77,81 ****
-
- cout << "\nend of test\n";
-
- }
- -
- --- 78,82 ----
-
- cout << "\nend of test\n";
-
- + return 0;
- }
- *** 1.1 1992/03/22 21:15:45
- --- trandom.cc 1993/07/13 20:01:45
- ***************
- *** 99,102 ****
- --- 99,103 ----
- h += r6();
- h.printBuckets(cout);
- cout << "\nEnd of test\n";
- + return 0;
- }
- *** 1.2 1992/07/21 14:47:55
- --- trationa.cc 1993/07/13 20:01:46
- ***************
- *** 58,64 ****
- --- 58,70 ----
- Rational half(1, 2);
- assert(half.OK());
-
- + Rational two(2);
- + Rational zero(0);
- + Rational r;
- + r = two+zero;
- +
- cout << "one = " << one << "\n";
- + cout << "two = " << r << "\n";
- cout << "third = " << third << "\n";
- cout << "half = " << half << "\n";
-
- ***************
- *** 125,132 ****
- --- 131,140 ----
- assert(!(approxpi == rpi));
- assert(!(approxpi <= rpi));
- assert(!(approxpi < rpi));
- + #ifdef __GNUC__
- assert((approxpi >? rpi) == approxpi);
- assert((approxpi <? rpi) == rpi);
- + #endif
-
- assert(floor(approxpi) == 3);
- assert(ceil(approxpi) == 4);
- ***************
- *** 173,179 ****
- cout << "approxe = " << approxe << "\n";
- }
-
- ! main()
- {
- simpletest();
- pitest();
- --- 181,187 ----
- cout << "approxe = " << approxe << "\n";
- }
-
- ! int main()
- {
- simpletest();
- pitest();
- ***************
- *** 182,185 ****
- --- 190,194 ----
- etest(100);
- etest(1000);
- cout << "\nEnd of test\n";
- + return 0;
- }
- *** 1.2 1992/05/29 15:07:55
- --- tstring.cc 1993/07/13 20:01:46
- ***************
- *** 5,10 ****
- --- 5,11 ----
- */
-
- #include <xstring.h>
- + #include <stream.h> // see note below on `dec(20)' about why this will go away
- #include <std.h>
- #include <assert.h>
-
- ***************
- *** 57,62 ****
- --- 58,67 ----
- assert(z.OK());
- assert(z == "@");
-
- + // XXX: `dec' is obsolete. Since String.h includes iostream.h, and not
- + // stream.h, we include stream.h in this file for the time being. This
- + // test will be rewritten to be done the "right" way, but for now, let's
- + // save some time and go the easy route.
- String n = dec(20);
- cout << "A string initialized to dec(20):" << n << "\n";
- assert(n.OK());
- ***************
- *** 323,329 ****
- assert(w[2] == "has");
- assert(w[3] == "five");
- assert(w[4] == "words");
- ! assert(w[5] == 0);
-
- z = join(w, nw, "/");
- cout << "z = join(w, nw, /); z =" << z << "\n";
- --- 328,334 ----
- assert(w[2] == "has");
- assert(w[3] == "five");
- assert(w[4] == "words");
- ! assert(w[5] == (char*)0);
-
- z = join(w, nw, "/");
- cout << "z = join(w, nw, /); z =" << z << "\n";
- ***************
- *** 391,397 ****
- assert(x.freq(y) == 1); // SubString
- }
-
- ! main()
- {
- decltest();
- cattest();
- --- 396,402 ----
- assert(x.freq(y) == 1); // SubString
- }
-
- ! int main()
- {
- decltest();
- cattest();
- ***************
- *** 405,410 ****
- identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
- iotest();
- cout << "\nEnd of test\n";
- }
- -
- -
- --- 410,414 ----
- identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
- iotest();
- cout << "\nEnd of test\n";
- + return 0;
- }
-