File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1042,7 +1042,7 @@ TEST_F(TUSchedulerTests, CommandLineWarnings) {
1042
1042
1043
1043
TEST (DebouncePolicy, Compute) {
1044
1044
namespace c = std::chrono;
1045
- std::vector< DebouncePolicy::clock::duration> History = {
1045
+ DebouncePolicy::clock::duration History[] = {
1046
1046
c::seconds (0 ),
1047
1047
c::seconds (5 ),
1048
1048
c::seconds (10 ),
@@ -1053,8 +1053,9 @@ TEST(DebouncePolicy, Compute) {
1053
1053
Policy.Max = c::seconds (25 );
1054
1054
// Call Policy.compute(History) and return seconds as a float.
1055
1055
auto Compute = [&](llvm::ArrayRef<DebouncePolicy::clock::duration> History) {
1056
- using FloatingSeconds = c::duration<float , c::seconds::period>;
1057
- return static_cast <float >(Policy.compute (History) / FloatingSeconds (1 ));
1056
+ return c::duration_cast<c::duration<float , c::seconds::period>>(
1057
+ Policy.compute (History))
1058
+ .count ();
1058
1059
};
1059
1060
EXPECT_NEAR (10 , Compute (History), 0.01 ) << " (upper) median = 10" ;
1060
1061
Policy.RebuildRatio = 1.5 ;
You can’t perform that action at this time.
0 commit comments