Skip to content

Commit 3ead62e

Browse files
Address review feedback (3 comments)
1 parent 3effb1e commit 3ead62e

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

tools/plugin/modules/ov_noise_suppression/test_ns_shape_validation.cpp

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
//
3-
// Copyright(c) 2026 OrbisAI Security. All rights reserved.
3+
// Copyright(c) 2024 Intel Corporation. All rights reserved.
44
//
5-
// Author: OrbisAI Security <mediratta01.pally@gmail.com>
5+
// Author: Security Team
66

77
#include <cstdio>
88
#include <cstdlib>
@@ -119,21 +119,31 @@ int main(int argc, char **argv)
119119
model_path = scratch;
120120
}
121121

122-
setenv("NOISE_SUPPRESSION_MODEL_NAME", model_path.c_str(), 1);
122+
struct noise_suppression_data *nd =
123+
(struct noise_suppression_data *)std::calloc(1, sizeof(*nd));
124+
if (!nd) {
125+
std::perror("calloc");
126+
if (!scratch.empty())
127+
std::remove(scratch.c_str());
128+
return 2;
129+
}
123130

124-
ns_handle h = nullptr;
125-
int rc = ov_ns_init(&h);
126-
if (h)
127-
ov_ns_free(h);
131+
int ret = ov_ns_init(nd, model_path.c_str());
128132

129133
if (!scratch.empty())
130134
std::remove(scratch.c_str());
131135

132-
bool rejected = (rc != 0);
136+
bool rejected = (ret != 0);
133137
bool pass = (rejected == expect_reject);
134138

135-
std::printf("model=%s rc=%d expect=%s -> %s\n", model_path.c_str(), rc,
136-
expect_reject ? "reject" : "ok",
137-
pass ? "PASS" : "FAIL");
139+
std::printf("%s: ov_ns_init() returned %d (%s), expected %s\n",
140+
pass ? "PASS" : "FAIL",
141+
ret,
142+
rejected ? "rejected" : "accepted",
143+
expect_reject ? "reject" : "ok");
144+
145+
ov_ns_free(nd);
146+
std::free(nd);
147+
138148
return pass ? 0 : 1;
139149
}

0 commit comments

Comments
 (0)