% testFindRange.m   test findRange.m
% Andrew Baker for CISC106, sect 10A, 10/01/2007


% tolerance is low because sine function is being used which should produce
% an exact answer

tolerance = 0.001;

% Test 1

expected = 10.2041;
actual = findRange(10, 45);
diff = abs(expected-actual);

if (diff < tolerance)
  disp('test 1 passed');
else
  disp('test 1 failed');
  expected
  actual
end
  

% Test 2

expected = 21.8135;
actual = findRange(25,10);
diff = abs(expected-actual);

if (diff < tolerance)
  disp('test 2 passed');
else
  disp('test 2 failed');
  expected
  actual
end
  

% end testFindRange.m