Skip to content

Commit 9ec7c5f

Browse files
author
Gopalakrishnan Nallasamy
committed
Address remaining EPContext review comments
1 parent 84f6b0d commit 9ec7c5f

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

onnxruntime/test/autoep/library/ep_context_data_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ inline std::string PathToUtf8String(const std::filesystem::path& path) {
7979

8080
inline OrtStatus* ResolveEpContextDataPath(const OrtApi& api, const char* file_name, const OrtGraph* graph,
8181
std::filesystem::path& data_path) {
82+
data_path.clear();
83+
8284
if (file_name == nullptr || file_name[0] == '\0') {
8385
return api.CreateStatus(ORT_INVALID_ARGUMENT, "EPContext data file name must not be empty");
8486
}

onnxruntime/test/autoep/test_execution.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,15 @@ TEST(OrtEpLibrary, EpContextDataUtils_ResolvePathAndInvalidArguments) {
647647
const auto fake_ep_api = MakeFakeEpApi();
648648
std::filesystem::path data_path;
649649

650+
data_path = "stale.ctx";
650651
ExpectOrtStatusError(ep_context_data_utils::ResolveEpContextDataPath(api, nullptr, nullptr, data_path),
651652
ORT_INVALID_ARGUMENT, "EPContext data file name must not be empty");
653+
EXPECT_TRUE(data_path.empty());
654+
655+
data_path = "stale.ctx";
652656
ExpectOrtStatusError(ep_context_data_utils::ResolveEpContextDataPath(api, "", nullptr, data_path),
653657
ORT_INVALID_ARGUMENT, "EPContext data file name must not be empty");
658+
EXPECT_TRUE(data_path.empty());
654659

655660
ASSERT_ORTSTATUS_OK(ep_context_data_utils::ResolveEpContextDataPath(api, "relative.ctx", nullptr, data_path));
656661
EXPECT_EQ(ep_context_data_utils::PathToUtf8String(data_path), "relative.ctx");

onnxruntime/test/framework/ep_plugin_provider_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "core/framework/op_kernel.h"
1919
#include "core/framework/resource_accountant.h"
2020
#include "core/graph/constants.h"
21-
#include "core/graph/ep_api_types.h"
2221
#include "core/graph/graph_viewer.h"
2322
#include "core/graph/model.h"
2423
#include "core/optimizer/graph_optimizer_registry.h"

0 commit comments

Comments
 (0)