\i Infrastructure-TestHeader.sql

\echo '$Id: 0-integrity-OutOfRangeInput.sql 95 2007-03-19 13:59:35Z dflater $'
\echo
\echo 'Verify that voter input values exceeding 1 (for N-of-M) or N (for'
\echo 'Cumulative) are detected by the integrity check.  The "All results'
\echo 'should be empty" notice does not apply to this test case.  Refer'
\echo 'instead to the "Expected results" printed at the bottom.'

\i 0-integrity-common.sql

-- 1-of-M
update VoterInput
  set Value = 2
  where BallotId = 2 and ChoiceId = 1;
-- 2-of-M
update VoterInput
  set Value = 2
  where BallotId = 2 and ChoiceId = 4;
-- Cumulative (2)
update VoterInput
  set Value = 3
  where BallotId = 8 and ChoiceId = 7;

\i Infrastructure-IntegrityChecks.sql

\echo 'Expected results:'
\echo '  Out Of Range Voter Inputs'
\echo ' ballotid | choiceid | value '
\echo '----------+----------+-------'
\echo '        2 |        1 |     2'
\echo '        2 |        4 |     2'
\echo '        8 |        7 |     3'
\echo '(3 rows)'

\i Infrastructure-TestFooter.sql
