mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Replace reinterpret_cast with FromAPI/ToAPI where possible
This brings more type safety to the code and is marginally more readable. Bug: None Change-Id: I0330a8a8e95cd9b8b531af266acd8fdc50c50460 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71606 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
9dc3c0bc86
commit
c6d3a840da
@@ -73,7 +73,7 @@ TEST_F(FeatureTests, GetEnabledFeatures) {
|
||||
dawn_native::DawnDeviceDescriptor deviceDescriptor;
|
||||
deviceDescriptor.requiredFeatures = {featureName};
|
||||
dawn_native::DeviceBase* deviceBase =
|
||||
reinterpret_cast<dawn_native::DeviceBase*>(adapter.CreateDevice(&deviceDescriptor));
|
||||
dawn_native::FromAPI(adapter.CreateDevice(&deviceDescriptor));
|
||||
std::vector<const char*> enabledFeatures = deviceBase->GetEnabledFeatures();
|
||||
ASSERT_EQ(1u, enabledFeatures.size());
|
||||
ASSERT_EQ(0, std::strcmp(featureName, enabledFeatures[0]));
|
||||
|
||||
Reference in New Issue
Block a user