Advertisement
hitlerdidnothingwron

Untitled

Nov 11th, 2016
1,633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include "Point.h"
  4. #include "Line.h"
  5. #include "Color.h"
  6. #include "Circle.h"
  7. #include "Rectangle.h"
  8. #include <fstream>
  9. #include <string>
  10. #include <cmath>
  11. #include <algorithm>
  12. #include "Triangle.h"
  13.  
  14. /**
  15. * Test.cpp
  16. *
  17. * EECS 183, Fall 2016
  18. * Project 4: CoolPics
  19. *
  20. * John Dorsey, Patrick Ahimovic
  21. * jsdorsey, paddya
  22. *
  23. * Test suite for all relevant test cases
  24. */
  25.  
  26. int main() {
  27. // test of point class
  28. Point p88888;
  29. Point p1(90,50);
  30. Point p2(5, 10);
  31. p1.setX(2);
  32. p1.setY(1);
  33.  
  34. cout << "( " << p1.getX()
  35. << ", " << p1.getY()
  36. << " )" << endl;
  37. p1.read(cin);
  38. cout << p1 << endl;
  39. cout << p2 << endl;
  40. cout << "( " << p2.getX()
  41. << ", " << p2.getY()
  42. << " )" << endl;
  43.  
  44. Point p3(4,4);
  45. p3.setX(0);
  46. p3.setY(0);
  47.  
  48. cout << "( " << p3.getX()
  49. << ", " << p3.getY()
  50. << " )" << endl;
  51.  
  52. Point p4(7,17);
  53. p4.setX(-2);
  54. p4.setY(-10);
  55.  
  56. cout << "( " << p4.getX()
  57. << p4.getY();
  58.  
  59. // test of circle class
  60.  
  61. Circle circ1;
  62. Circle circdesoleil(p4, 5, 5);
  63. Color color99(0,0,0);
  64. circ1.setRadius(55);
  65. circ1.setCenter(p4);
  66. circ1.setColor(color99);
  67. circ1.getColor();
  68.  
  69.  
  70. Color color1;
  71. color1.setRed(-1);
  72. color1.setBlue(9);
  73. color1.setGreen(256);
  74. color1.setGreen(0);
  75. color1.setRed(0);
  76. color1.setBlue(0);
  77. color1.setBlue(-999);
  78. color1.setBlue(2555);
  79. color1.setRed(300);
  80. color1.setGreen(3000);
  81. color1.setGreen(-100);
  82. Color color3(5, 5, 5);
  83. int yyy = 0;
  84. yyy += color3.getRed();
  85. yyy += color3.getBlue();
  86. yyy += color3.getGreen();
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. // test of line class
  94. Line l1;
  95. Color xsaaf;
  96. Color r(3,3,3);
  97. Color awadawd(-3, -3, -9);
  98. Color monkees(255, 259, 250);
  99. Point a(55,13);
  100. Point nineteen(-3, -3);
  101. Point b(8,69);
  102. Line l2(a, b, r);
  103. a.setX(4);
  104. a.setY(0);
  105. b.setX(2);
  106. b.setY(0);
  107. l1.setStart(a);
  108. l1.setEnd(b);
  109. cout << l1;
  110. cout << l1.getStart() << " "
  111. << l1.getEnd() << " " <<
  112. l1.getColor();
  113. Line l3;
  114. Line l4(p3, p4, color3);
  115. // need to test write
  116.  
  117. // test of rectangle class
  118. Rectangle r1;
  119. Color c;
  120. Color c2;
  121. Color c3(9, 9, 9);
  122. Point x;
  123. Rectangle r2(a, b, c);
  124. Rectangle r3(a, b, c, c, c, c);
  125. cout << r2.getStart() << " "
  126. << r2.getEnd() << " " <<
  127. r2.getColorBottomLeft();
  128. r2.setColor(c2);
  129. r2.setColorTopLeft(c3);
  130. r2.setColorTopRight(c3);
  131. r2.setColorBottomLeft(c3);
  132. r2.setColorBottomRight(c3);
  133. r2.setStart(x);
  134.  
  135. // test of triangle class
  136. Triangle t1;
  137. Color ctri1;
  138. Color ctri2;
  139. Color ctri3;
  140. Color ctri4;
  141. Point ptri1;
  142. Point ptri2;
  143. Point ptri3;
  144. Triangle t2(ptri1, ptri2, ptri3, ctri1);
  145. Triangle t3(ptri1, ctri1, ptri2, ctri2, ptri3, ctri3);
  146. cout << t2.getVertexOne() << " " << t2.getVertexOneColor() <<
  147. " " << t2.getVertexTwo() << " " << t2.getVertexTwoColor() <<
  148. " " << t2.getVertexThree() << " " << t2.getVertexThreeColor();
  149. t1.setVertexThree(ptri2);
  150. t1.setVertexTwo(p4);
  151. t1.setVertexOne(ptri1);
  152. t1.getVertexThreeColor();
  153.  
  154. // need to test write
  155.  
  156.  
  157. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement