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