1 Script started on Tue Jan 19 16:21:37 1999 2 ctkierst@fitch.math[33]% cat valid Check that comments are handled correctly. 3 * Verify initial status of vectors Verify that the vectors are initialized correctly, and that the status command returns the correct set of information for a vector that only contains zeroes. 4 s 0 5 s 1 6 s 2 Fetching an element from a vector that only contains zeroes should returns a 0. 7 ? 0 5 Verify that all other vectors were left untouched by the previous command. 8 s 0 9 s 1 10 s 2 Assigning a 0 to an index of the vector should not cause its status information to change. 11 = 0 0 0 Verify that all other vectors were left untouched by the previous command. 12 s 0 13 s 1 14 s 2 Verify that adding elements to a vector only containing zeroes is handled correctly as are all subsequent additions. 15 = 1 9 10 16 = 1 2 -1 17 = 1 100 101 Use the status to check the number of non-zero elements and range of indices for the non-zero elements to ensure that elements were correctly added. Also serves to double-check the status command. 18 s 1 Extend the index range in one direction, and fetch several elements (the first should be non-zero, the second should be 0). Use the status command to verify that everything was done properly. 19 = 1 -10 -9 20 ? 1 100 21 ? 1 99 22 s 1 23 ctkierst@fitch.math[34]% cat invalid Test too few parameters. 24 = 25 = 0 26 = x Test an invalid vector specification. 27 = 0 1 28 = 9 1 Test invalid integer specifications. 29 = 0 x 30 = 0 1 x 31 = 9 1 1 1 32 = 0 1 1 x 33 = 9 1 1 Repeat above tests on '?' and 's' commands. 34 ? 35 ? 9 36 ? x 37 ? 0 x 38 = 9 39 ? 9 1 40 ? 0 1 1 41 ? 0 1 x 42 s 0 1 43 ? 9 1 1 44 s 45 s 9 46 s x 47 s 0 x 48 ctkierst@fitch.math[35]% ./flexvec < invalid 49 ERROR: invalid number of parameters for '='. Correctly picks up too few parameters. 50 ERROR: invalid vector specification 'x' entered. Correctly notices a non-integer vector number. 51 ERROR: invalid vector specification '9' entered. Correctly notices a vector number that is out of range. 52 ERROR: invalid subscript specification 'x' entered. Correctly notices a non-integer vector subscript. 53 ERROR: invalid integer value for assignment 'x'. Correctly notices a non-integer assignment value. 54 ERROR: invalid number of parameters for '= 9 1 1 1'. 55 ERROR: invalid number of parameters for '= 0 1 1 x'. Rejects commands that have too many parameters. 56 ERROR: invalid vector specification '9' entered. Correctly notices a vector number that is out of range. 57 ERROR: invalid number of parameters for '?'. 58 ERROR: invalid vector specification '9' entered. Correctly notices a vector number that is out of range. 59 ERROR: invalid vector specification 'x' entered. 60 ERROR: invalid subscript specification 'x' entered. Correctly notices a non-integer vector number and subscript. 61 ERROR: invalid vector specification '9' entered. 62 ERROR: invalid vector specification '9' entered. Correctly notices a vector number that is out of range. 63 ERROR: invalid number of parameters for '? 0 1 1'. 64 ERROR: invalid number of parameters for '? 0 1 x'. 65 ERROR: invalid number of parameters for 's 0 1'. Rejects commands with too many parameters. 66 ERROR: invalid vector specification '9' entered. Correctly notices a non-integer vector number. 67 ERROR: invalid number of parameters for 's'. Rejects commands with too few parameters. 68 ERROR: invalid vector specification '9' entered. Correctly notices a vector number that is out of range. 69 ERROR: invalid vector specification 'x' entered. Correctly notices a non-integer vector number. 70 ERROR: invalid number of parameters for 's 0 x'. Rejects command with too many parameters. 71 cs343_ctkierst@fitch.math[36]% ./flexvec < valid 72 Vector0 has 0 non-zero entries. 73 Vector1 has 0 non-zero entries. 74 Vector2 has 0 non-zero entries. It works right. 75 '?' returns 0 76 Vector0 has 0 non-zero entries. 77 Vector1 has 0 non-zero entries. 78 Vector2 has 0 non-zero entries. All vectors left unchanged by fetch operation. 79 Vector0 has 0 non-zero entries. 80 Vector1 has 0 non-zero entries. 81 Vector2 has 0 non-zero entries. Added a 0 element. All vectors left unchanged by assignment operation. 82 Vector1 has 3 non-zero entries. Vector subscripts are in the range [2, 100]. Index range correctly expanded. Has correct number of non-zero entries. 83 '?' returns 101 Returns correct non-zero value associated with given index. 84 '?' returns 0 Correctly returns 0 for an index whose value was never set. 85 Vector1 has 4 non-zero entries. Vector subscripts are in the range [-10, 100]. Index range correctly expanded. Has correct number of non-zero entries. 86 cs343_ctkierst@fitch.math[37]% exit 87 script done on Thu Jan 21 08:48:25 1999