MCPcopy Index your code
hub / github.com/careercup/ctci / doTest

Method doTest

java/Chapter 7/Question7_5/Question.java:30–43  ·  view source on GitHub ↗
(Square s1, Square s2, Point start, Point end)

Source from the content-addressed store, hash-verified

28 }
29
30 public static boolean doTest(Square s1, Square s2, Point start, Point end) {
31 Line line = s1.cut(s2);
32 boolean r = (isApproxEqual(line.start, start) && isApproxEqual(line.end, end)) || (isApproxEqual(line.start, end) && isApproxEqual(line.end, start));
33 if (!r) {
34 printSquare(s1);
35 printSquare(s2);
36 printLine(line);
37 System.out.println(start.toString());
38 System.out.println(end.toString());
39 System.out.println();
40 return r;
41 }
42 return r;
43 }
44
45 public static boolean doTestFull(Square s1, Square s2, Point start, Point end) {
46 return doTest(s1, s2, start, end) && doTest(s2, s1, start, end);

Callers 1

doTestFullMethod · 0.95

Calls 5

isApproxEqualMethod · 0.95
printSquareMethod · 0.95
printLineMethod · 0.95
cutMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected