// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40285824): Remove this and convert code to safer constructs. #pragma allow_unsafe_buffers #endif #include "remoting/base/running_samples.h" #include <stddef.h> #include <stdint.h> #include "testing/gtest/include/gtest/gtest.h" namespace remoting { TestFunction; static const int64_t kTestValues[] = …; // Test framework that verifies average() and max() at beginning, iterates // through all elements and meanwhile calls your own test function static void TestFramework(int windowSize, TestFunction testFn) { … } // Average across a single element, i.e. just return the most recent. TEST(RunningSamplesTest, AverageOneElementWindow) { … } // Average the two most recent elements. TEST(RunningSamplesTest, AverageTwoElementWindow) { … } // Average across all the elements if the window size exceeds the element count. TEST(RunningSamplesTest, AverageLongWindow) { … } // Max of a single element, i.e. just return the most recent. TEST(RunningSamplesTest, MaxOneElementWindow) { … } // Max of the two most recent elements. TEST(RunningSamplesTest, MaxTwoElementWindow) { … } // Max of all the elements if the window size exceeds the element count. TEST(RunningSamplesTest, MaxLongWindow) { … } } // namespace remoting