CS 3733 Operating Systems, Spring 2003 Assignment 0 Comments

This assignment was graded on a basis of 20 points. Everyone who sent me email for this assignment got at least 10 points. Between 0 and 10 points was assigned for the readline function. Most grades for readline were 0, 5 or 10. General comments about readline appear below. If you send me eamil for assignment 0, you should have received an email from me in the morning on January 27. This email should contain a statement indicating which of the readline implementations in the following link is yours. If you sent me two copies, the one with the higher grade is the one that counts. Click here for comments on individual implementations of readline. It is clear that most people did not test the readline that was sent to me by email. The assignment stated that you were to debug the function as well as you could. You should have written a main program that called readline and tested it with as many possibilities as you could think of. Here are the major ones:

  1. an empty line (no characters before the end of file)
  2. a simple line (shorter than nbytes and ending with a newline)
  3. a line much too long (more than nbytes before the newline)
  4. no newline: an end of file long before nbytes
  5. lines with a newline near the boundary of nbytes. In each case calculate the return value before doing the test and then compare the results.
    1. nbytes-3 characters before the newline
    2. nbytes-2 characters before the newline
    3. nbytes-1 characters before the newline
    4. nbytes characters before the newline
    5. nbytes+1 characters before the newline
    6. nbytes+2 characters before the newline
In each case you should check that the return value is correct, and if the return value is greater than 0, then the characters put in buf should be checked to see that they are correct.