home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / bc-1.03-base.tgz / bc-1.03-base.tar / fsf / bc / Test / checklib.b < prev    next >
Text File  |  1994-11-04  |  1KB  |  110 lines

  1. define t (x,y,d,s,t) {
  2.    auto u, v, w, i, b, c;
  3.  
  4.    if (s >= t) {
  5.      "Bad Scales. Try again.
  6. ";   return;
  7.    }
  8.  
  9.    for (i = x; i < y; i += d) {
  10.      scale = s;
  11.      u = f(i);
  12.      scale = t;
  13.      v = f(i);
  14.      scale = s;
  15.      w = v / 1;
  16.      b += 1;
  17.      if (u != w) {
  18.        c += 1;
  19. "
  20. Failed:  
  21. "
  22.        "  index = "; i;
  23.        "  val1 = "; u;
  24.        "  val2 = "; v;
  25. "
  26. "
  27.      }
  28.    }
  29.  
  30. "
  31. Total tests:    "; b;
  32. "
  33. Total failures: "; c;
  34. "
  35. Percent failed: "; scale = 2; c*100/b;
  36.  
  37. }
  38.  
  39. /*
  40.    b = begining scale value, 
  41.    l = limit scale value,
  42.    i = increment scale value.
  43.  
  44.    if b is set to a non-zero value before this file is executed,
  45.    b, l and i are not reset.
  46. */
  47.  
  48. if (b == 0) { b = 10; l = 61; i = 10; }
  49.  
  50. "
  51. Checking e(x)"
  52. define f(x) {
  53.   return (e(x))
  54. }
  55. for (s=10; s<l; s=s+i) {
  56. "
  57. scale = "; s
  58. j = t(0,200,1,s,s+4)
  59. }
  60.  
  61. "
  62. Checking l(x)"
  63. define f(x) {
  64.   return (l(x))
  65. }
  66. for (s=10; s<l; s=s+i) {
  67. "
  68. scale = "; s
  69. j = t(1,10000,25,s,s+4)
  70. }
  71.  
  72. "
  73. Checking s(x)"
  74. define f(x) {
  75.   return (s(x))
  76. }
  77. for (s=10; s<l; s=s+i) {
  78. "
  79. scale = "; s
  80. j = t(0,8*a(1),.01,s,s+4)
  81. }
  82.  
  83. "
  84. Checking a(x)"
  85. define f(x) {
  86.   return (a(x))
  87. }
  88. for (s=10; s<l; s=s+i) {
  89. "
  90. scale = "; s
  91. j = t(-1000,1000,10,s,s+4)
  92. }
  93.  
  94. "
  95. Checking j(n,x)"
  96. define f(x) {
  97.   return (j(n,x))
  98. }
  99. for (s=10; s<l; s=s+i) {
  100. "
  101. n=0, scale = "; s
  102. n=0
  103. j = t(0,30,.1,s,s+4)
  104. "
  105. n=1, scale = "; s
  106. n=1
  107. j = t(0,30,.1,s,s+4)
  108. }
  109.  
  110.