-
Notifications
You must be signed in to change notification settings - Fork 67
test: return invalid argument when rawData size is passed as 0 to tracer #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Related-To: VLCLJ-2678 Signed-off-by: Shreyas Kunder <shreyas.kunder@intel.com>
Related-To: VLCLJ-2678 Signed-off-by: Shreyas Kunder <shreyas.kunder@intel.com>
Related-To: VLCLJ-2678 Signed-off-by: Shreyas Kunder <shreyas.kunder@intel.com>
Related-To: VLCLJ-2678 Signed-off-by: Shreyas Kunder <shreyas.kunder@intel.com>
| EXPECT_EQ(ZE_RESULT_NOT_READY, | ||
| zetMetricTracerReadDataExp(metric_tracer_handle, &raw_data_size, | ||
| nullptr)) | ||
| raw_data.data())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check that raw_data_size is 0 on return
|
|
||
| LZT_TEST_F( | ||
| zetMetricTracerTest, | ||
| GivenTracerIsEnabledWhenQueryingForDataSizeWithZeroSizeThenExpectInvalidArgumentError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: some minor rewarding.
"GivenTracerIsEnabledWhenQueryingForDataSizeThenExpectInvalidArgumentError" . No need to say withZeroSize.
Ideally, for clarity, can add a comment saying something in the lines of "tracer read data does not allow querying for available size "
| LOG_DEBUG << "synchronize with completion of workload"; | ||
| lzt::synchronize(command_queue, std::numeric_limits<uint64_t>::max()); | ||
|
|
||
| size_t raw_data_size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please confirm, but I suspect this test does not need to run any workload. Since it is just an API param check.
| LZT_TEST_F( | ||
| zetMetricTracerTest, | ||
| GivenTracerIsEnabledWhenRequestingMoreRawDataThanAvailableThenReturnOnlyWhatIsAvailable) { | ||
| /* When allocating a larger buffer than needed, ensure that writes happen only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this test does not make sense any more since you cannot know how much size is available.
Instead seems there should be a test that sets a small buffer and confirms can read multiple times, concatenate data and call calculate and data is valid. This will be the most used case.
Related-To: VLCLJ-2678