Skip to content

Commit 07f1095

Browse files
authored
Update backend_integration_test.cpp
1 parent eba4909 commit 07f1095

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

runtime/executor/test/backend_integration_test.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,20 @@ TEST_P(BackendIntegrationTest, GetBackendNamesSuccess) {
362362
EXPECT_TRUE(method_meta->uses_backend(StubBackend::kName));
363363

364364
// Retrieve the number of backends.
365-
size_t num_backends = method_meta->num_backends();
365+
const size_t num_backends = method_meta->num_backends();
366366
EXPECT_GT(num_backends, 0u);
367367

368368
// Iterate through each backend and verify its name.
369369
for (size_t i = 0; i < num_backends; ++i) {
370-
const char* name = method_meta->get_backend_name(i);
371-
EXPECT_NE(name, nullptr);
370+
auto backend_name_result = method_meta->get_backend_name(i);
371+
ASSERT_TRUE(backend_name_result.ok());
372+
const char* name = backend_name_result.get();
372373
// For this test, we expect that the only backend is StubBackend.
373374
EXPECT_STREQ(name, StubBackend::kName);
374375
}
375-
// Check that an out-of-range index returns nullptr.
376-
EXPECT_EQ(method_meta->get_backend_name(num_backends), nullptr);
376+
// Check that an out-of-range index returns an error.
377+
auto out_of_range_result = method_meta->get_backend_name(num_backends);
378+
EXPECT_FALSE(out_of_range_result.ok());
377379
}
378380

379381
TEST_P(BackendIntegrationTest, FreeingProcessedBufferSucceeds) {

0 commit comments

Comments
 (0)