1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Test Executor
3 * ------------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief Test batch result.
22 *//*--------------------------------------------------------------------*/
24 #include "xeBatchResult.hpp"
36 InfoLog::InfoLog (void)
40 void InfoLog::append (const deUint8* bytes, size_t numBytes)
42 DE_ASSERT(numBytes > 0);
43 const size_t oldSize = m_data.size();
44 m_data.resize(oldSize+numBytes);
45 deMemcpy(&m_data[oldSize], bytes, numBytes);
50 TestCaseResultData::TestCaseResultData (const char* casePath)
51 : m_casePath (casePath)
52 , m_statusCode (TESTSTATUSCODE_LAST)
56 TestCaseResultData::~TestCaseResultData (void)
60 void TestCaseResultData::setTestResult (TestStatusCode statusCode, const char* statusDetails)
62 m_statusCode = statusCode;
63 m_statusDetails = statusDetails;
66 void TestCaseResultData::clear (void)
68 m_statusCode = TESTSTATUSCODE_LAST;
69 m_statusDetails.clear();
76 BatchResult::BatchResult (void)
80 BatchResult::~BatchResult (void)
84 bool BatchResult::hasTestCaseResult (const char* casePath) const
86 return m_resultMap.find(casePath) != m_resultMap.end();
89 ConstTestCaseResultPtr BatchResult::getTestCaseResult (const char* casePath) const
91 map<string, int>::const_iterator pos = m_resultMap.find(casePath);
92 DE_ASSERT(pos != m_resultMap.end());
93 return getTestCaseResult(pos->second);
96 TestCaseResultPtr BatchResult::getTestCaseResult (const char* casePath)
98 map<string, int>::const_iterator pos = m_resultMap.find(casePath);
99 DE_ASSERT(pos != m_resultMap.end());
100 return getTestCaseResult(pos->second);
103 TestCaseResultPtr BatchResult::createTestCaseResult (const char* casePath)
105 DE_ASSERT(!hasTestCaseResult(casePath));
107 m_testCaseResults.reserve(m_testCaseResults.size()+1);
108 m_resultMap[casePath] = (int)m_testCaseResults.size();
110 TestCaseResultPtr caseResult(new TestCaseResultData(casePath));
111 m_testCaseResults.push_back(caseResult);