OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the Chromium LICENSE file. | 3 // found in the Chromium LICENSE file. |
4 | 4 |
5 #include "qcms.h" | 5 #include "qcms.h" |
6 #include "qcms_test_util.h" | 6 #include "qcms_test_util.h" |
7 #include "timing.h" | 7 #include "timing.h" |
8 | 8 |
9 #include <math.h> | 9 #include <math.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #include <stdlib.h> | 11 #include <stdlib.h> |
12 #include <string.h> | 12 #include <string.h> |
13 | 13 |
14 // Manually update the items below to add more tests. | 14 // Manually update the items below to add more tests. |
15 #ifdef SSE2_ENABLE | |
radu.velea
2016/03/04 13:33:08
These look like too many ifdef's to me. Maybe we s
lmilko
2016/03/08 13:21:59
Done.
| |
15 extern struct qcms_test_case qcms_test_tetra_clut_rgba_info; | 16 extern struct qcms_test_case qcms_test_tetra_clut_rgba_info; |
17 #endif | |
16 extern struct qcms_test_case qcms_test_munsell_info; | 18 extern struct qcms_test_case qcms_test_munsell_info; |
17 extern struct qcms_test_case qcms_test_internal_srgb_info; | 19 extern struct qcms_test_case qcms_test_internal_srgb_info; |
18 extern struct qcms_test_case qcms_test_ntsc_gamut_info; | 20 extern struct qcms_test_case qcms_test_ntsc_gamut_info; |
19 | 21 |
22 #ifdef SSE2_ENABLE | |
20 struct qcms_test_case qcms_test[4]; | 23 struct qcms_test_case qcms_test[4]; |
24 #else | |
25 struct qcms_test_case qcms_test[3]; | |
26 #endif | |
27 | |
21 #define TEST_CASES (sizeof(qcms_test) / sizeof(qcms_test[0])) | 28 #define TEST_CASES (sizeof(qcms_test) / sizeof(qcms_test[0])) |
22 | 29 |
23 static void initialize_tests() | 30 static void initialize_tests() |
24 { | 31 { |
32 #ifdef SSE2_ENABLE | |
25 qcms_test[0] = qcms_test_tetra_clut_rgba_info; | 33 qcms_test[0] = qcms_test_tetra_clut_rgba_info; |
26 qcms_test[1] = qcms_test_munsell_info; | 34 qcms_test[1] = qcms_test_munsell_info; |
27 qcms_test[2] = qcms_test_internal_srgb_info; | 35 qcms_test[2] = qcms_test_internal_srgb_info; |
28 qcms_test[3] = qcms_test_ntsc_gamut_info; | 36 qcms_test[3] = qcms_test_ntsc_gamut_info; |
37 #else | |
38 qcms_test[0] = qcms_test_munsell_info; | |
39 qcms_test[1] = qcms_test_internal_srgb_info; | |
40 qcms_test[2] = qcms_test_ntsc_gamut_info; | |
41 #endif | |
29 } | 42 } |
30 | 43 |
31 static void list_tests() | 44 static void list_tests() |
32 { | 45 { |
33 int i; | 46 int i; |
34 printf("Available qcms tests:\n"); | 47 printf("Available qcms tests:\n"); |
35 | 48 |
36 for (i = 0; i < TEST_CASES; ++i) { | 49 for (i = 0; i < TEST_CASES; ++i) { |
37 printf("\t%s\n", qcms_test[i].test_name); | 50 printf("\t%s\n", qcms_test[i].test_name); |
38 } | 51 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 | 143 |
131 exit_status = 0; | 144 exit_status = 0; |
132 | 145 |
133 for (i = 0; i < TEST_CASES; ++i) { | 146 for (i = 0; i < TEST_CASES; ++i) { |
134 if (run_all || QCMS_TEST_ENABLED == qcms_test[i].status) | 147 if (run_all || QCMS_TEST_ENABLED == qcms_test[i].status) |
135 exit_status += qcms_test[i].test_fn(width, height, iterations, in, o ut, force_software); | 148 exit_status += qcms_test[i].test_fn(width, height, iterations, in, o ut, force_software); |
136 } | 149 } |
137 | 150 |
138 return exit_status; | 151 return exit_status; |
139 } | 152 } |
OLD | NEW |