-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempt to fix an ASAN error. exercise smolscale usage in more test
- Loading branch information
1 parent
9f75fe9
commit 2090162
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Exercise the library toensure there are no memory errors when | ||
# used with R. | ||
# Any such errors will hopefully be picked up the test builds for: | ||
# clang-asan, rchk, valgrind | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
test_that("smolscale works", { | ||
|
||
nr <- nr_duplicate(deer_sprites[[1]]) | ||
for (w in c(10, 100, 400, 1000)) { | ||
expect_no_error({ | ||
nr_resize(nr, w, w) | ||
}) | ||
} | ||
|
||
|
||
orders <- c('RGBA', 'BGRA', 'ARGB', 'ABGR') | ||
|
||
|
||
for (src_order in orders) { | ||
for (target_order in orders) { | ||
for (src_pm_alpha in c(TRUE, FALSE)) { | ||
for (target_pm_alpha in c(TRUE, FALSE)) { | ||
expect_no_error({ | ||
nr <- nr_duplicate(deer_sprites[[1]]) | ||
nr_swizzle(nr, order = src_order, pm_alpha = src_pm_alpha, | ||
target_order = target_order, target_pm_alpha = target_pm_alpha) | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
}) |