Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include "Point.h"
- #include "Line.h"
- #include "Color.h"
- #include "Circle.h"
- #include "Rectangle.h"
- #include <fstream>
- #include <string>
- #include <cmath>
- #include <algorithm>
- #include "Triangle.h"
- /**
- * Test.cpp
- *
- * EECS 183, Fall 2016
- * Project 4: CoolPics
- *
- * John Dorsey, Patrick Ahimovic
- * jsdorsey, paddya
- *
- * Test suite for all relevant test cases
- */
- int main() {
- // test of point class
- Point p88888;
- Point p1(90,50);
- Point p2(5, 10);
- p1.setX(2);
- p1.setY(1);
- cout << "( " << p1.getX()
- << ", " << p1.getY()
- << " )" << endl;
- p1.read(cin);
- cout << p1 << endl;
- cout << p2 << endl;
- cout << "( " << p2.getX()
- << ", " << p2.getY()
- << " )" << endl;
- Point p3(4,4);
- p3.setX(0);
- p3.setY(0);
- cout << "( " << p3.getX()
- << ", " << p3.getY()
- << " )" << endl;
- Point p4(7,17);
- p4.setX(-2);
- p4.setY(-10);
- cout << "( " << p4.getX()
- << p4.getY();
- // test of circle class
- Circle circ1;
- Circle circdesoleil(p4, 5, 5);
- Color color99(0,0,0);
- circ1.setRadius(55);
- circ1.setCenter(p4);
- circ1.setColor(color99);
- circ1.getColor();
- Color color1;
- color1.setRed(-1);
- color1.setBlue(9);
- color1.setGreen(256);
- color1.setGreen(0);
- color1.setRed(0);
- color1.setBlue(0);
- color1.setBlue(-999);
- color1.setBlue(2555);
- color1.setRed(300);
- color1.setGreen(3000);
- color1.setGreen(-100);
- Color color3(5, 5, 5);
- int yyy = 0;
- yyy += color3.getRed();
- yyy += color3.getBlue();
- yyy += color3.getGreen();
- // test of line class
- Line l1;
- Color xsaaf;
- Color r(3,3,3);
- Color awadawd(-3, -3, -9);
- Color monkees(255, 259, 250);
- Point a(55,13);
- Point nineteen(-3, -3);
- Point b(8,69);
- Line l2(a, b, r);
- a.setX(4);
- a.setY(0);
- b.setX(2);
- b.setY(0);
- l1.setStart(a);
- l1.setEnd(b);
- cout << l1;
- cout << l1.getStart() << " "
- << l1.getEnd() << " " <<
- l1.getColor();
- Line l3;
- Line l4(p3, p4, color3);
- // need to test write
- // test of rectangle class
- Rectangle r1;
- Color c;
- Color c2;
- Color c3(9, 9, 9);
- Point x;
- Rectangle r2(a, b, c);
- Rectangle r3(a, b, c, c, c, c);
- cout << r2.getStart() << " "
- << r2.getEnd() << " " <<
- r2.getColorBottomLeft();
- r2.setColor(c2);
- r2.setColorTopLeft(c3);
- r2.setColorTopRight(c3);
- r2.setColorBottomLeft(c3);
- r2.setColorBottomRight(c3);
- r2.setStart(x);
- // test of triangle class
- Triangle t1;
- Color ctri1;
- Color ctri2;
- Color ctri3;
- Color ctri4;
- Point ptri1;
- Point ptri2;
- Point ptri3;
- Triangle t2(ptri1, ptri2, ptri3, ctri1);
- Triangle t3(ptri1, ctri1, ptri2, ctri2, ptri3, ctri3);
- cout << t2.getVertexOne() << " " << t2.getVertexOneColor() <<
- " " << t2.getVertexTwo() << " " << t2.getVertexTwoColor() <<
- " " << t2.getVertexThree() << " " << t2.getVertexThreeColor();
- t1.setVertexThree(ptri2);
- t1.setVertexTwo(p4);
- t1.setVertexOne(ptri1);
- t1.getVertexThreeColor();
- // need to test write
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement