CS 215 Project 2 Submission Errors

This document gives some examples of the email the submission system will send for common submission errors. The grading script does the following steps:

If the submitted makefile has errors, an error message will be emitted, but the grading script will go on to attempt to compile the autotest program. If that compilation fails, the grading script stops.

The autotest program uses operator<< for some later tests. If for some reason it is incorrect, testing stops after this point.

The lines starting with "***" come from the grading script and appear at the beginning and end of the various test sections.

Compilation of submitted program succeeds, but autotest program fails to compile due to missing accessor consts

In this example, the to_string and day_of_week member functions were not made const. There may be random characters in the output from clang++

testdate.cpp:423:15: error: 'this' argument to member function 'to_string' has type 'const Date', but function is not marked const
   string s = date.to_string();
              ^~~~
./date.h:18:19: note: 'to_string' declared here
      std::string to_string () // const;
^
testdate.cpp:450:8: error: 'this' argument to member function 'day_of_week' has type 'const Date', but function is not marked const
   s = date.day_of_week();
       ^~~~
./date.h:20:19: note: 'day_of_week' declared here
      std::string day_of_week () // const;
^

8< snip >8 - additional errors omitted to save space

Makefile.testdate:11: recipe for target 'testdate.o' failed
make: *** [testdate.o] Error 1
*** FAILED to compile autotest program ***

Compilation of submitted program succeeds, but autotest program fails to compile due to missing parameter consts

In this example, the right-hand operand to operator<< is a reference parameter that was not made const.

testdate.cpp:469:8: error: invalid operands to binary expression ('std::ostringstream' (aka 'basic_ostringstream') and 'const Date')
   out << date;
   ~~~ ^  ~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ostream:245:7: note: candidate function not viable: no known conversion from 'const Date' to 'const void *' for 1st argument; take the address of the argument with &
      operator<<(const void* __p)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/system_error:217:5: note: candidate function not viable: no known conversion from 'const Date' to 'const std::error_code' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/ostream:502:5: note: candidate function not viable: no known conversion from 'const Date' to 'char' for 2nd argument
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
				     ^
				     
8< snip >8  - many, many lines of error messages suggesting all the different
definitions of operator<< omitted...

15 errors generated.
Makefile.testdate:11: recipe for target 'testdate.o' failed
make: *** [testdate.o] Error 1
*** FAILED to compile autotest program ***

Compilation of submitted program does not create datedriver, but autotest program compiles and runs successfully

Note that although the autotest program tests all succeed, the submission as a whole has failed. This is a makefile error.

Compiling Project 2
*** Failed to produce executable file named datedriver ***
Compiling autotest program
Running autotest program

8< snip >8 - autotest program output omitted...

*** Autotests passed, but submitted makefile FAILED to create executable datedriver ***

Autotest program compiled and ran, but day_of_week member function is incorrect

Compiling Project 2
Compiling autotest program
Running autotest program
Testing accessors and <<
   default constructed date
   For date 1/1/2019
      day_of_week returns Wednesday, expecting Tuesday
   explict-value constructed dates
   For date 1/1/2005
      day_of_week returns Sunday, expecting Saturday
   For date 2/1/2005
      day_of_week returns Wednesday, expecting Tuesday
*** One or more incorrect results for accessor tests

8< snip >8 - remaining autotest program output omitted...

*** FAILED 1 or more automated submission tests ***

Note that the error messages are indented under the test that caused the error.

Autotest program compiled and ran, but operator< friend function is incorrect

Compiling Project 2
Compiling autotest program
Running autotest program
Testing accessors and <<
   default constructed date
   explict-value constructed dates
*** PASSED accessors and << tests
Testing equality and relational operators against 4/6/1963
   equal dates
   date2 - lesser day
      reverse < error: 4/1/1963 < 4/6/1963 should return true, returns false
   date2 - greater day
      < error: 4/6/1963 < 4/8/1963 should return true, returns false
      <= error: 4/6/1963 <= 4/8/1963 should return true, returns false
      > error: 4/6/1963 > 4/8/1963 should return false, returns true
      >= error: 4/6/1963 >= 4/8/1963 should return false, returns true
   date2 - lesser month
      reverse < error: 3/6/1963 < 4/6/1963 should return true, returns false
   date2 - lesser month, lesser day
      reverse < error: 3/1/1963 < 4/6/1963 should return true, returns false
   date2 - lesser month, greater day
      reverse < error: 3/8/1963 < 4/6/1963 should return true, returns false
   date2 - greater month
      < error: 4/6/1963 < 8/6/1963 should return true, returns false
      <= error: 4/6/1963 <= 8/6/1963 should return true, returns false
      > error: 4/6/1963 > 8/6/1963 should return false, returns true
      >= error: 4/6/1963 >= 8/6/1963 should return false, returns true
   date2 - greater month, lesser day
      < error: 4/6/1963 < 8/1/1963 should return true, returns false
      <= error: 4/6/1963 <= 8/1/1963 should return true, returns false
      > error: 4/6/1963 > 8/1/1963 should return false, returns true
      >= error: 4/6/1963 >= 8/1/1963 should return false, returns true
   date2 - greater month, greater day after
      < error: 4/6/1963 < 8/8/1963 should return true, returns false
      <= error: 4/6/1963 <= 8/8/1963 should return true, returns false
      > error: 4/6/1963 > 8/8/1963 should return false, returns true
      >= error: 4/6/1963 >= 8/8/1963 should return false, returns true
   date2 - lesser year
      reverse < error: 4/6/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, lesser day
      reverse < error: 4/1/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, greater day
      reverse < error: 4/8/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, lesser month
      reverse < error: 3/6/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, lesser month, lesser day
   date2 - lesser year, lesser month, greater day
      reverse < error: 3/8/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, greater month
      reverse < error: 8/6/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, greater month, lesser day
      reverse < error: 8/1/1962 < 4/6/1963 should return true, returns false
   date2 - lesser year, greater month, greater day
      reverse < error: 8/8/1962 < 4/6/1963 should return true, returns false
   date2 - greater year
      < error: 4/6/1963 < 4/6/1970 should return true, returns false
      <= error: 4/6/1963 <= 4/6/1970 should return true, returns false
      > error: 4/6/1963 > 4/6/1970 should return false, returns true
      >= error: 4/6/1963 >= 4/6/1970 should return false, returns true
   date2 - greater year, lesser day
      < error: 4/6/1963 < 4/1/1970 should return true, returns false
      <= error: 4/6/1963 <= 4/1/1970 should return true, returns false
      > error: 4/6/1963 > 4/1/1970 should return false, returns true
      >= error: 4/6/1963 >= 4/1/1970 should return false, returns true
   date2 - greater year, greater day
      < error: 4/6/1963 < 4/8/1970 should return true, returns false
      <= error: 4/6/1963 <= 4/8/1970 should return true, returns false
      > error: 4/6/1963 > 4/8/1970 should return false, returns true
      >= error: 4/6/1963 >= 4/8/1970 should return false, returns true
   date2 - greater year, lesser month
      < error: 4/6/1963 < 3/6/1970 should return true, returns false
      <= error: 4/6/1963 <= 3/6/1970 should return true, returns false
      > error: 4/6/1963 > 3/6/1970 should return false, returns true
      >= error: 4/6/1963 >= 3/6/1970 should return false, returns true
   date2 - greater year, lesser month, lesser day
      < error: 4/6/1963 < 3/1/1970 should return true, returns false
      <= error: 4/6/1963 <= 3/1/1970 should return true, returns false
      > error: 4/6/1963 > 3/1/1970 should return false, returns true
      >= error: 4/6/1963 >= 3/1/1970 should return false, returns true
   date2 - greater year, lesser month, greater day
      < error: 4/6/1963 < 3/8/1970 should return true, returns false
      <= error: 4/6/1963 <= 3/8/1970 should return true, returns false
      > error: 4/6/1963 > 3/8/1970 should return false, returns true
      >= error: 4/6/1963 >= 3/8/1970 should return false, returns true
   date2 - greater year, greater month
      < error: 4/6/1963 < 8/6/1970 should return true, returns false
      <= error: 4/6/1963 <= 8/6/1970 should return true, returns false
      > error: 4/6/1963 > 8/6/1970 should return false, returns true
      >= error: 4/6/1963 >= 8/6/1970 should return false, returns true
   date2 - greater year, greater month, lesser day
      < error: 4/6/1963 < 8/1/1970 should return true, returns false
      <= error: 4/6/1963 <= 8/1/1970 should return true, returns false
      > error: 4/6/1963 > 8/1/1970 should return false, returns true
      >= error: 4/6/1963 >= 8/1/1970 should return false, returns true
   date2 - greater year, greater month, greater day
*** One or more incorrect results for comparison operators,
    most probably operator < ***

						       
8< snip >8 - remaining autotest program output omitted...

*** FAILED 1 or more automated submission tests ***

Both programs compiled and the autotest program ran successfully

This is the email that should be received if everything works. Note that the warning message comes from the constructor when the parameters do not form a legal date, and there should be one for each test.

Compiling Project 2
Compiling autotest program
Running autotest program
Testing accessors and <<
   default constructed date
   explict-value constructed dates
*** PASSED accessors and << tests
Testing equality and relational operators against 4/6/1963
   equal dates
   date2 - lesser day
   date2 - greater day
   date2 - lesser month
   date2 - lesser month, lesser day
   date2 - lesser month, greater day
   date2 - greater month
   date2 - greater month, lesser day
   date2 - greater month, greater day after
   date2 - lesser year
   date2 - lesser year, lesser day
   date2 - lesser year, greater day
   date2 - lesser year, lesser month
   date2 - lesser year, lesser month, lesser day
   date2 - lesser year, lesser month, greater day
   date2 - lesser year, greater month
   date2 - lesser year, greater month, lesser day
   date2 - lesser year, greater month, greater day
   date2 - greater year
   date2 - greater year, lesser day
   date2 - greater year, greater day
   date2 - greater year, lesser month
   date2 - greater year, lesser month, lesser day
   date2 - greater year, lesser month, greater day
   date2 - greater year, greater month
   date2 - greater year, greater month, lesser day
   date2 - greater year, greater month, greater day
*** PASSED comparison operator tests
Testing >>
   Reading in 8/27/1965
   Reading in 3/20/1999
   Reading in 9/5/1966
*** PASSED >> tests
Testing constructor invariant tests
   month out of range
Warning: invalid date; making value 1/1/2019
   day in January out of range
Warning: invalid date; making value 1/1/2019
   day in non-leap year February out of range
Warning: invalid date; making value 1/1/2019
   day in non-leap year February out of range
Warning: invalid date; making value 1/1/2019
   day in leap year February out of range
Warning: invalid date; making value 1/1/2019
   day in March out of range
Warning: invalid date; making value 1/1/2019
   day in April out of range
Warning: invalid date; making value 1/1/2019
   day in May out of range
Warning: invalid date; making value 1/1/2019
   day in June out of range
Warning: invalid date; making value 1/1/2019
   day in July out of range
Warning: invalid date; making value 1/1/2019
   day in August out of range
Warning: invalid date; making value 1/1/2019
   day in September out of range
Warning: invalid date; making value 1/1/2019
   day in October out of range
Warning: invalid date; making value 1/1/2019
   day in November out of range
Warning: invalid date; making value 1/1/2019
   day in December out of range
Warning: invalid date; making value 1/1/2019
Testing >> invariant tests
   month out of range
   day in January out of range
   day in non-leap year February out of range
   day in non-leap year February out of range
   day in leap year February out of range
   day in March out of range
   day in April out of range
   day in May out of range
   day in June out of range
   day in July out of range
   day in August out of range
   day in September out of range
   day in October out of range
   day in November out of range
   day in December out of range
   invalid punctuation
   invalid punctuation
   non-digit characters
*** PASSED >> invariant tests
*** PASSED all automated submission tests ***