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

Side by Side Diff: tests/skia_test.cpp

Issue 1811613004: Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not overflow. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebase. Created 4 years, 9 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
« no previous file with comments | « tests/Test.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "OverwriteLine.h" 9 #include "OverwriteLine.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 bool verbose() const override { return FLAGS_veryVerbose; } 89 bool verbose() const override { return FLAGS_veryVerbose; }
90 void reportFailed(const skiatest::Failure& failure) override { 90 void reportFailed(const skiatest::Failure& failure) override {
91 SkDebugf("\nFAILED: %s", failure.toString().c_str()); 91 SkDebugf("\nFAILED: %s", failure.toString().c_str());
92 fError = true; 92 fError = true;
93 } 93 }
94 bool fError; 94 bool fError;
95 int fTestCount; 95 int fTestCount;
96 } reporter; 96 } reporter;
97 97
98 const SkMSec start = SkTime::GetMSecs(); 98 const Timer timer;
99 fTest.proc(&reporter, fGrContextFactory); 99 fTest.proc(&reporter, fGrContextFactory);
100 SkMSec elapsed = SkTime::GetMSecs() - start; 100 SkMSec elapsed = timer.elapsedMsInt();
101 if (reporter.fError) { 101 if (reporter.fError) {
102 fStatus->reportFailure(); 102 fStatus->reportFailure();
103 } 103 }
104 fStatus->endTest(fTest.name, !reporter.fError, elapsed, 104 fStatus->endTest(fTest.name, !reporter.fError, elapsed,
105 reporter.fTestCount); 105 reporter.fTestCount);
106 } 106 }
107 107
108 private: 108 private:
109 Test fTest; 109 Test fTest;
110 Status* fStatus; 110 Status* fStatus;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 SkDebugf("\n"); 220 SkDebugf("\n");
221 return (status.failCount() == 0) ? 0 : 1; 221 return (status.failCount() == 0) ? 0 : 1;
222 } 222 }
223 223
224 #if !defined(SK_BUILD_FOR_IOS) 224 #if !defined(SK_BUILD_FOR_IOS)
225 int main(int argc, char** argv) { 225 int main(int argc, char** argv) {
226 SkCommandLineFlags::Parse(argc, argv); 226 SkCommandLineFlags::Parse(argc, argv);
227 return test_main(); 227 return test_main();
228 } 228 }
229 #endif 229 #endif
OLDNEW
« no previous file with comments | « tests/Test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698