xref: /aosp_15_r20/external/deqp/executor/xeTestCaseResult.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program Test Executor
3  * ------------------------------------------
4  *
5  * Copyright 2014 The Android Open Source Project
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  *//*!
20  * \file
21  * \brief Test case result models.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "xeTestCaseResult.hpp"
25 
26 #include <iomanip>
27 #include <limits>
28 
29 namespace xe
30 {
31 
getTestStatusCodeName(TestStatusCode code)32 const char *getTestStatusCodeName(TestStatusCode code)
33 {
34     switch (code)
35     {
36     case TESTSTATUSCODE_PASS:
37         return "Pass";
38     case TESTSTATUSCODE_FAIL:
39         return "Fail";
40     case TESTSTATUSCODE_QUALITY_WARNING:
41         return "QualityWarning";
42     case TESTSTATUSCODE_COMPATIBILITY_WARNING:
43         return "CompatibilityWarning";
44     case TESTSTATUSCODE_PENDING:
45         return "Pending";
46     case TESTSTATUSCODE_RUNNING:
47         return "Running";
48     case TESTSTATUSCODE_NOT_SUPPORTED:
49         return "NotSupported";
50     case TESTSTATUSCODE_RESOURCE_ERROR:
51         return "ResourceError";
52     case TESTSTATUSCODE_INTERNAL_ERROR:
53         return "InternalError";
54     case TESTSTATUSCODE_CANCELED:
55         return "Canceled";
56     case TESTSTATUSCODE_TIMEOUT:
57         return "Timeout";
58     case TESTSTATUSCODE_CRASH:
59         return "Crash";
60     case TESTSTATUSCODE_DISABLED:
61         return "Disabled";
62     case TESTSTATUSCODE_TERMINATED:
63         return "Terminated";
64     case TESTSTATUSCODE_WAIVER:
65         return "Waived";
66     default:
67         DE_ASSERT(false);
68         return DE_NULL;
69     }
70 }
71 
72 namespace ri
73 {
74 
List(void)75 List::List(void)
76 {
77 }
78 
~List(void)79 List::~List(void)
80 {
81     for (std::vector<Item *>::iterator i = m_items.begin(); i != m_items.end(); i++)
82         delete *i;
83     m_items.clear();
84 }
85 
operator <<(std::ostream & str,const NumericValue & value)86 std::ostream &operator<<(std::ostream &str, const NumericValue &value)
87 {
88     switch (value.getType())
89     {
90     case NumericValue::NUMVALTYPE_FLOAT64:
91         return str << std::setprecision(std::numeric_limits<double>::digits10 + 2) << value.getFloat64();
92 
93     case NumericValue::NUMVALTYPE_INT64:
94         return str << value.getInt64();
95 
96     default:
97         DE_ASSERT(value.getType() == NumericValue::NUMVALTYPE_EMPTY);
98         return str;
99     }
100 }
101 
102 } // namespace ri
103 } // namespace xe
104