% testIsOdd.m   test isOdd.m
% P. Conrad for CISC106, sect 99, 09/25/2007

% Test function to determine whether number is odd or not


%%%%%%%%%%%%%%%%%
% Run the tests %
%%%%%%%%%%%%%%%%%

% Test 1

actual = isOdd(2);
expected = false;


if (actual == expected)
  disp('test 1 passed');
else
  disp('test 1 failed');
  expected
  actual
end
  

% Test 2

actual = isOdd(7);
expected = true;


if (actual == expected)
  disp('test 2 passed');
else
  % signal that test failed, and print both expected and actual
  disp('test 2 failed');
  expected
  actual
end
  



% Test 3

actual = isOdd(-7);
expected = true;


if (actual == expected)
  disp('test 3 passed');
else
  % signal that test failed, and print both expected and actual
  disp('test 3 failed');
  expected
  actual
end

% Test 4

actual = isOdd(-2);
expected = false;


if (actual == expected)
  disp('test 4 passed');
else
  % signal that test failed, and print both expected and actual
  disp('test 4 failed');
  expected
  actual
end


% end testIsOdd.m









