Files
hardware_interfaces/graphics/composer/2.4/utils/vts/TestCommandReader.cpp
Ady Abraham f6820b2b44 composer: add TestCommandReader to 2.4
Add a TestCommandReader to composer 2.4 VTS to parse correctly the
new commands introduced in 2.4.

Test: adb shell /data/nativetest64/VtsHalGraphicsComposerV2_4TargetTest/VtsHalGraphicsComposerV2_4TargetTest
Bug: 149124892
Change-Id: Ide4f98fa3bfc771e4095cc672f59b87e1aa03427
2020-02-10 11:24:04 -08:00

39 lines
1.3 KiB
C++

/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <composer-vts/2.4/TestCommandReader.h>
#include <gtest/gtest.h>
namespace android::hardware::graphics::composer::V2_4::vts {
void TestCommandReader::parseSingleCommand(int32_t commandRaw, uint16_t length) {
IComposerClient::Command command = static_cast<IComposerClient::Command>(commandRaw);
switch (command) {
case IComposerClient::Command::SET_CLIENT_TARGET_PROPERTY:
ASSERT_EQ(2, length);
read();
close(readFence());
break;
default:
return android::hardware::graphics::composer::V2_1::vts::TestCommandReader::
parseSingleCommand(commandRaw, length);
}
}
} // namespace android::hardware::graphics::composer::V2_4::vts