Skip to content

Commit

Permalink
Update tests/accessor_legacy/accessor_api_buffer_common.h
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Žužek <[email protected]>
  • Loading branch information
bader and ProGTX authored Aug 22, 2023
1 parent 02a199a commit 1af776c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/accessor_legacy/accessor_api_buffer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ class check_buffer_accessor_api_methods {

// Ensure accessor doesn't target an empty range. If it were the case, even
// get_pointer() would return unspecified value.
for (int i = 0; i < dims; ++i)
if (accessRange[i] == 0) accessRange[i] = 1;
for (int i = 0; i < dims; ++i) {
if (accessRange[i] == 0) {
accessRange[i] = 1;
}
}

const size_t accessedCount = dims == 0 ? 1 : accessRange.size();
const size_t accessedSize = accessedCount * sizeof(T);
Expand Down

0 comments on commit 1af776c

Please sign in to comment.