Browse Source

Vk: Device(..., const DeviceCreateInfo&) wasn't covered.

Interestingly enough, apparently I was always constructing it in-place
in the Device constructor. Which leads me to the next issue...
pull/491/head
Vladimír Vondruš 5 years ago
parent
commit
4933583f7f
  1. 19
      src/Magnum/Vk/Test/DeviceVkTest.cpp

19
src/Magnum/Vk/Test/DeviceVkTest.cpp

@ -60,6 +60,7 @@ struct DeviceVkTest: VulkanTester {
void construct();
void constructQueueFromFlags();
void constructExtensions();
void constructDeviceCreateInfoConstReference();
void constructTransferDeviceProperties();
void constructExtensionsCommandLineDisable();
void constructExtensionsCommandLineEnable();
@ -141,6 +142,7 @@ DeviceVkTest::DeviceVkTest(): VulkanTester{NoCreate} {
&DeviceVkTest::construct,
&DeviceVkTest::constructQueueFromFlags,
&DeviceVkTest::constructExtensions,
&DeviceVkTest::constructDeviceCreateInfoConstReference,
&DeviceVkTest::constructTransferDeviceProperties});
addInstancedTests({&DeviceVkTest::constructExtensionsCommandLineDisable,
@ -370,6 +372,23 @@ void DeviceVkTest::constructExtensions() {
CORRADE_VERIFY(device->TrimCommandPoolKHR);
}
void DeviceVkTest::constructDeviceCreateInfoConstReference() {
Queue queue{NoCreate};
DeviceProperties deviceProperties = pickDevice(instance());
DeviceCreateInfo info{deviceProperties};
info.addQueues(0, {0.0f}, {queue});
/* Just to verify the overload taking const DeviceProperties& works as
well (most of the above tests verified a move) */
Device device{instance(), info};
CORRADE_VERIFY(device.handle());
/* Device properties should be lazy-populated and different from the
above instances because we didn't transfer the ownership here either */
CORRADE_COMPARE(device.properties().name(), deviceProperties.name());
CORRADE_VERIFY(&device.properties().properties() != &deviceProperties.properties());
}
void DeviceVkTest::constructTransferDeviceProperties() {
DeviceProperties deviceProperties = pickDevice(instance());
const void* vkProperties = &deviceProperties.properties();

Loading…
Cancel
Save