FreeRDP
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 #ifdef _WIN32
30 #define ALIGN(x) x
31 #else
32 #define ALIGN(x) x DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)
33 #endif
34 
35 #define ABS(_x_) ((_x_) < 0 ? (-(_x_)) : (_x_))
36 #define MAX_TEST_SIZE 4096
37 
38 extern int test_sizes[];
39 #define NUM_TEST_SIZES 10
40 
41 extern BOOL g_TestPrimitivesPerformance;
42 extern UINT32 g_Iterations;
43 
44 extern primitives_t* generic;
45 extern primitives_t* optimized;
46 
47 void prim_test_setup(BOOL performance);
48 
49 typedef pstatus_t (*speed_test_fkt)();
50 
51 BOOL speed_test(const char* name, const char* dsc, UINT32 iterations, speed_test_fkt generic,
52  speed_test_fkt optimized, ...);
53 
54 #endif /* FREERDP_LIB_PRIMTEST_H */