Skip to content

Commit

Permalink
Add static analysis fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jemale Lockett <jemale.lockett@intel.com>
  • Loading branch information
Jemale committed Sep 26, 2024
1 parent e0eb0fa commit cad0645
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 12 additions & 3 deletions utils/image/test/image_integration_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ TEST(ImageIntegrationTests, WritesPNGFile) {

level_zero_tests::ImagePNG32Bit output("output.png");
EXPECT_EQ(output.get_pixels(), pixels);
std::remove("output.png");
auto result = std::remove("output.png");
if (result != 0) {
std::cerr << "Error deleting file output.png" << std::endl;
}

EXPECT_EQ(image.get_pixels(), pixels);
}
Expand Down Expand Up @@ -72,7 +75,10 @@ TEST(ImageIntegrationTests, WritesGrayscaleBMPFile) {

level_zero_tests::ImageBMP8Bit output("output.bmp");
EXPECT_EQ(output.get_pixels(), pixels);
std::remove("output.bmp");
auto result = std::remove("output.bmp");
if (result != 0) {
std::cerr << "Error deleting file output.bmp" << std::endl;
}

EXPECT_EQ(image.get_pixels(), pixels);
}
Expand Down Expand Up @@ -104,7 +110,10 @@ TEST(ImageIntegrationTests, WritesColorBMPFile) {

level_zero_tests::ImageBMP32Bit output("output.bmp");
EXPECT_EQ(output.get_pixels(), pixels);
std::remove("output.bmp");
auto result = std::remove("output.bmp");
if (result != 0) {
std::cerr << "Error deleting file output.bmp" << std::endl;
}

EXPECT_EQ(image.get_pixels(), pixels);
}
5 changes: 4 additions & 1 deletion utils/test_harness/src/test_harness_cmdqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ ze_command_queue_handle_t create_command_queue(
zeCommandQueue::zeCommandQueue() { command_queue_ = create_command_queue(); }

zeCommandQueue::~zeCommandQueue() {
EXPECT_EQ(ZE_RESULT_SUCCESS, zeCommandQueueDestroy(command_queue_));
auto result = zeCommandQueueDestroy(command_queue_);
if (result != ZE_RESULT_SUCCESS) {
LOG_ERROR << "zeCommandQueueDestroy failed: " << lzt::to_string(result);
}
}

void execute_command_lists(ze_command_queue_handle_t cq,
Expand Down

0 comments on commit cad0645

Please sign in to comment.