@@ -107,22 +107,30 @@ TEST_P(CommandListCacheTest, ImmediateCommandListsHaveProperAttributes) {
107
107
device->ZeDevice , IsInOrder, Ordinal, Mode, Priority, Index);
108
108
109
109
ze_device_handle_t ZeDevice;
110
- ASSERT_EQ (
111
- zeCommandListGetDeviceHandle (CommandList.get (), &ZeDevice),
112
- ZE_RESULT_SUCCESS);
113
- ASSERT_EQ (ZeDevice, device->ZeDevice );
110
+ auto Ret =
111
+ zeCommandListGetDeviceHandle (CommandList.get (), &ZeDevice);
112
+ if (Ret == ZE_RESULT_SUCCESS) {
113
+ ASSERT_EQ (ZeDevice, device->ZeDevice );
114
+ } else {
115
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
116
+ }
114
117
115
118
uint32_t ActualOrdinal;
116
- ASSERT_EQ (
117
- zeCommandListGetOrdinal (CommandList.get (), &ActualOrdinal),
118
- ZE_RESULT_SUCCESS);
119
- ASSERT_EQ (ActualOrdinal, Ordinal);
119
+ Ret = zeCommandListGetOrdinal (CommandList.get (), &ActualOrdinal);
120
+ if (Ret == ZE_RESULT_SUCCESS) {
121
+ ASSERT_EQ (ActualOrdinal, Ordinal);
122
+ } else {
123
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
124
+ }
120
125
121
126
uint32_t ActualIndex;
122
- ASSERT_EQ (
123
- zeCommandListImmediateGetIndex (CommandList.get (), &ActualIndex),
124
- ZE_RESULT_SUCCESS);
125
- ASSERT_EQ (ActualIndex, Index);
127
+ Ret =
128
+ zeCommandListImmediateGetIndex (CommandList.get (), &ActualIndex);
129
+ if (Ret == ZE_RESULT_SUCCESS) {
130
+ ASSERT_EQ (ActualIndex, Index);
131
+ } else {
132
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
133
+ }
126
134
127
135
// store the list back to the cache
128
136
cache.addImmediateCommandList (std::move (CommandList),
@@ -135,19 +143,27 @@ TEST_P(CommandListCacheTest, ImmediateCommandListsHaveProperAttributes) {
135
143
device->ZeDevice , IsInOrder, Ordinal, Mode, Priority, std::nullopt);
136
144
137
145
ze_device_handle_t ZeDevice;
138
- ASSERT_EQ (zeCommandListGetDeviceHandle (CommandList.get (), &ZeDevice),
139
- ZE_RESULT_SUCCESS);
140
- ASSERT_EQ (ZeDevice, device->ZeDevice );
146
+ auto Ret = zeCommandListGetDeviceHandle (CommandList.get (), &ZeDevice);
147
+ if (Ret == ZE_RESULT_SUCCESS) {
148
+ ASSERT_EQ (ZeDevice, device->ZeDevice );
149
+ } else {
150
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
151
+ }
141
152
142
153
uint32_t ActualOrdinal;
143
- ASSERT_EQ (zeCommandListGetOrdinal (CommandList.get (), &ActualOrdinal),
144
- ZE_RESULT_SUCCESS);
145
- ASSERT_EQ (ActualOrdinal, Ordinal);
154
+ Ret = zeCommandListGetOrdinal (CommandList.get (), &ActualOrdinal);
155
+ if (Ret == ZE_RESULT_SUCCESS) {
156
+ ASSERT_EQ (ActualOrdinal, Ordinal);
157
+ } else {
158
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
159
+ }
146
160
147
161
uint32_t ActualIndex;
148
- ASSERT_EQ (
149
- zeCommandListImmediateGetIndex (CommandList.get (), &ActualIndex),
150
- ZE_RESULT_SUCCESS);
151
- ASSERT_EQ (ActualIndex, 0 );
162
+ Ret = zeCommandListImmediateGetIndex (CommandList.get (), &ActualIndex);
163
+ if (Ret == ZE_RESULT_SUCCESS) {
164
+ ASSERT_EQ (ActualIndex, 0 );
165
+ } else {
166
+ ASSERT_EQ (Ret, ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
167
+ }
152
168
}
153
169
}
0 commit comments