FreeRDP
Loading...
Searching...
No Matches
prim_test.h
1/* primtest.h
2 * vi:ts=4 sw=4
3 *
4 * (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing
12 * permissions and limitations under the License. Algorithms used by
13 * this code may be covered by patents by HP, Microsoft, or other parties.
14 */
15
16#ifndef FREERDP_LIB_PRIMTEST_H
17#define FREERDP_LIB_PRIMTEST_H
18
19#include <winpr/crt.h>
20#include <winpr/spec.h>
21#include <winpr/wtypes.h>
22#include <winpr/platform.h>
23#include <winpr/crypto.h>
24
25#include <freerdp/primitives.h>
26
27#include "measure.h"
28
29#define ABS(_x_) ((_x_) < 0 ? (-(_x_)) : (_x_))
30#define MAX_TEST_SIZE 4096
31
32extern int test_sizes[];
33#define NUM_TEST_SIZES 10
34
35extern BOOL g_TestPrimitivesPerformance;
36extern UINT32 g_Iterations;
37
38extern primitives_t* generic;
39extern primitives_t* optimized;
40
41void prim_test_setup(BOOL performance);
42
43typedef pstatus_t (*speed_test_fkt)();
44
45BOOL speed_test(const char* name, const char* dsc, UINT32 iterations, speed_test_fkt generic,
46 speed_test_fkt optimized, ...);
47
48#endif /* FREERDP_LIB_PRIMTEST_H */