Project 7 Basic Tests

Project 7 Basic Tests - Project 7 Basic Tests If you append...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Project 7 Basic Tests If you append the following to your robots.cpp file, precede your main routine with the declaration void doBasicTests(); , have your main routine call doBasicTests() , and build and run your project, you will test a number of basic aspects of your code. #include <cassert> void thisFunctionWillNeverBeCalled() { // If the student deleted or changed the manifest constants, this // won't compile. const bool b1 = (MAXROWS == 20 && MAXCOLS == 40 && UP == 0 && DOWN == 1 && LEFT == 2 && RIGHT == 3); char a1[b1]; // illegal 0-size array if b1 is false // If the student deleted or changed the interfaces to the public // functions, this won't compile. (This uses magic beyond the scope // of CS 31.) Robot r(static_cast<Arena*>(0), 1, 1); int (Robot::*pr1)() const = &Robot::row; int (Robot::*pr2)() const = &Robot::col; void (Robot::*pr3)() = &Robot::move; Player p(static_cast<Arena*>(0), 1, 1); int (Player::*pp1)() const = &Player::row; int
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Project 7 Basic Tests - Project 7 Basic Tests If you append...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online