mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Apply clang-format to all C, C++ and ObjC files (issue #2171)
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
#define CEF_TESTS_CEFCLIENT_RENDERER_PERFORMANCE_TEST_SETUP_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/base/cef_macros.h"
|
||||
#include "include/base/cef_logging.h"
|
||||
#include "include/base/cef_macros.h"
|
||||
|
||||
namespace client {
|
||||
namespace performance_test {
|
||||
@ -20,7 +20,7 @@ extern const int kDefaultIterations;
|
||||
|
||||
// Entry in test array.
|
||||
#define PERF_TEST_ENTRY_EX(name, iterations) \
|
||||
{ #name, PERF_TEST_NAME(name), iterations }
|
||||
{ #name, PERF_TEST_NAME(name), iterations }
|
||||
#define PERF_TEST_ENTRY(name) PERF_TEST_ENTRY_EX(name, kDefaultIterations)
|
||||
|
||||
// Test function declaration.
|
||||
@ -28,15 +28,14 @@ extern const int kDefaultIterations;
|
||||
#define PERF_TEST_PARAM_ITERATIONS iterations
|
||||
#define PERF_TEST_PARAMS int PERF_TEST_PARAM_ITERATIONS
|
||||
#define PERF_TEST_FUNC(name) \
|
||||
PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS)
|
||||
PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS)
|
||||
|
||||
// Typedef for test pointers.
|
||||
typedef PERF_TEST_RESULT(PerfTest(PERF_TEST_PARAMS));
|
||||
|
||||
class CefTimer {
|
||||
public:
|
||||
CefTimer() : running_(false) {
|
||||
}
|
||||
CefTimer() : running_(false) {}
|
||||
|
||||
bool IsRunning() { return running_; }
|
||||
|
||||
@ -67,25 +66,24 @@ class CefTimer {
|
||||
|
||||
// Peform test iterations using a user-provided timing result variable.
|
||||
#define PERF_ITERATIONS_START_EX() \
|
||||
{ \
|
||||
CefTimer _timer; \
|
||||
_timer.Start(); \
|
||||
for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
|
||||
|
||||
{ \
|
||||
CefTimer _timer; \
|
||||
_timer.Start(); \
|
||||
for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
|
||||
#define PERF_ITERATIONS_END_EX(result) \
|
||||
} \
|
||||
_timer.Stop(); \
|
||||
result = _timer.Delta(); \
|
||||
}
|
||||
} \
|
||||
_timer.Stop(); \
|
||||
result = _timer.Delta(); \
|
||||
}
|
||||
|
||||
// Perform test iterations and return the timing result.
|
||||
#define PERF_ITERATIONS_START() \
|
||||
int64 _result = 0; \
|
||||
PERF_ITERATIONS_START_EX()
|
||||
int64 _result = 0; \
|
||||
PERF_ITERATIONS_START_EX()
|
||||
|
||||
#define PERF_ITERATIONS_END() \
|
||||
PERF_ITERATIONS_END_EX(_result) \
|
||||
return _result;
|
||||
#define PERF_ITERATIONS_END() \
|
||||
PERF_ITERATIONS_END_EX(_result) \
|
||||
return _result;
|
||||
|
||||
// Perf test entry structure.
|
||||
struct PerfTestEntry {
|
||||
|
Reference in New Issue
Block a user