Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: third_party/WebKit/Source/platform/geometry/FloatBoxTestHelpers.cpp

Issue 2967013002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Dropped mojo parts that need another review. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return true; 47 return true;
48 } 48 }
49 49
50 ::testing::AssertionResult AssertAlmostEqual(const char* expr, 50 ::testing::AssertionResult AssertAlmostEqual(const char* expr,
51 const char* n_expr, 51 const char* n_expr,
52 const FloatBox& m, 52 const FloatBox& m,
53 const FloatBox& n) { 53 const FloatBox& n) {
54 if (!ApproximatelyEqual(m, n)) { 54 if (!ApproximatelyEqual(m, n)) {
55 return ::testing::AssertionFailure() 55 return ::testing::AssertionFailure()
56 << " Value of:" << n_expr << std::endl 56 << " Value of:" << n_expr << std::endl
57 << " Actual:" << testing::PrintToString(n) << std::endl 57 << " Actual:" << ::testing::PrintToString(n) << std::endl
58 << "Expected Approx:" << expr << std::endl 58 << "Expected Approx:" << expr << std::endl
59 << " Which is:" << ::testing::PrintToString(m); 59 << " Which is:" << ::testing::PrintToString(m);
60 } 60 }
61 return ::testing::AssertionSuccess(); 61 return ::testing::AssertionSuccess();
62 } 62 }
63 63
64 ::testing::AssertionResult AssertContains(const char* expr, 64 ::testing::AssertionResult AssertContains(const char* expr,
65 const char* n_expr, 65 const char* n_expr,
66 const FloatBox& m, 66 const FloatBox& m,
67 const FloatBox& n) { 67 const FloatBox& n) {
68 FloatBox new_m = m; 68 FloatBox new_m = m;
69 new_m.ExpandTo(n); 69 new_m.ExpandTo(n);
70 if (!ApproximatelyEqual(m, new_m)) { 70 if (!ApproximatelyEqual(m, new_m)) {
71 return ::testing::AssertionFailure() 71 return ::testing::AssertionFailure()
72 << " Value of:" << n_expr << std::endl 72 << " Value of:" << n_expr << std::endl
73 << " Actual:" << testing::PrintToString(n) << std::endl 73 << " Actual:" << ::testing::PrintToString(n) << std::endl
74 << "Not Contained in:" << expr << std::endl 74 << "Not Contained in:" << expr << std::endl
75 << " Which is:" << ::testing::PrintToString(m); 75 << " Which is:" << ::testing::PrintToString(m);
76 } 76 }
77 return ::testing::AssertionSuccess(); 77 return ::testing::AssertionSuccess();
78 } 78 }
79 79
80 } // namespace FloatBoxTest 80 } // namespace FloatBoxTest
81 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698