Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions onnxruntime/test/framework/ep_compatibility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModel_InvalidArgs) {
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general, the returned OrtStatus* should be released with ReleaseStatus() if it is not nullptr. the other code in this test does that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will patch in the parent branch.

ASSERT_NE(allocator, nullptr);

char* compat_info = nullptr;
Expand Down Expand Up @@ -581,7 +581,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModel_FileNotFound) {
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
ASSERT_NE(allocator, nullptr);

char* compat_info = nullptr;
Expand All @@ -596,7 +596,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModelBytes_InvalidArgs) {
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
ASSERT_NE(allocator, nullptr);

char* compat_info = nullptr;
Expand Down Expand Up @@ -653,7 +653,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModelBytes_InvalidModelDat
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
ASSERT_NE(allocator, nullptr);

char* compat_info = nullptr;
Expand All @@ -671,7 +671,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModelBytes_WithMetadata) {
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
ASSERT_NE(allocator, nullptr);

// Create a minimal ModelProto with compatibility metadata
Expand Down Expand Up @@ -702,7 +702,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModelBytes_WithMetadata) {
ASSERT_EQ(st, nullptr) << (st ? api->GetErrorMessage(st) : "");
ASSERT_NE(compat_info, nullptr);
EXPECT_STREQ(compat_info, expected_compat_info.c_str());
api->AllocatorFree(allocator, compat_info);
ASSERT_EQ(api->AllocatorFree(allocator, compat_info), nullptr);
}

// Test when compatibility info is not found for the EP
Expand All @@ -711,7 +711,7 @@ TEST(EpCompatibilityCapiTest, GetCompatibilityInfoFromModelBytes_NotFound) {
ASSERT_NE(api, nullptr);

OrtAllocator* allocator = nullptr;
api->GetAllocatorWithDefaultOptions(&allocator);
ASSERT_EQ(api->GetAllocatorWithDefaultOptions(&allocator), nullptr);
ASSERT_NE(allocator, nullptr);

// Create a minimal ModelProto without compatibility metadata for our EP
Expand Down
Loading