1 /*-------------------------------------------------------------------------
2 * drawElements Internal Test Module
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 log output tests.
22 *//*--------------------------------------------------------------------*/
24 #include "ditTestLogTests.hpp"
25 #include "tcuTestLog.hpp"
34 // \todo [2014-02-25 pyry] Extend with:
35 // - output of all element types
36 // - nested element cases (sections, image sets)
37 // - parse results and verify
39 class BasicSampleListCase : public tcu::TestCase
42 BasicSampleListCase (tcu::TestContext& testCtx)
43 : TestCase(testCtx, "sample_list", "Basic sample list usage")
47 IterateResult iterate (void)
49 TestLog& log = m_testCtx.getLog();
51 log << TestLog::SampleList("TestSamples", "Test Sample List")
52 << TestLog::SampleInfo
53 << TestLog::ValueInfo("NumDrawCalls", "Number of draw calls", "", QP_SAMPLE_VALUE_TAG_PREDICTOR)
54 << TestLog::ValueInfo("NumOps", "Number of ops in shader", "op", QP_SAMPLE_VALUE_TAG_PREDICTOR)
55 << TestLog::ValueInfo("RenderTime", "Rendering time", "ms", QP_SAMPLE_VALUE_TAG_RESPONSE)
56 << TestLog::EndSampleInfo;
58 log << TestLog::Sample << 1 << 2 << 2.3 << TestLog::EndSample
59 << TestLog::Sample << 0 << 0 << 0 << TestLog::EndSample
60 << TestLog::Sample << 421 << -23 << 0.00001 << TestLog::EndSample
61 << TestLog::Sample << 2 << 9 << -1e9 << TestLog::EndSample
62 << TestLog::Sample << std::numeric_limits<deInt64>::max() << std::numeric_limits<deInt64>::min() << -0.0f << TestLog::EndSample
63 << TestLog::Sample << 0x3355 << 0xf24 << std::numeric_limits<double>::max() << TestLog::EndSample;
65 log << TestLog::EndSampleList;
67 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
72 TestLogTests::TestLogTests (tcu::TestContext& testCtx)
73 : TestCaseGroup(testCtx, "testlog", "Test Log Tests")
77 TestLogTests::~TestLogTests (void)
81 void TestLogTests::init (void)
83 addChild(new BasicSampleListCase(m_testCtx));