| 1 |
test_that("header and DLL API versions match", { |
| 2 |
Rcpp::cppFunction( |
| 3 |
code = ' |
| 4 |
int later_dll_api_version() { |
| 5 |
int (*dll_api_version)() = (int (*)()) R_GetCCallable("later", "apiVersion"); |
| 6 |
return (*dll_api_version)(); |
| 7 |
} |
| 8 |
' |
| 9 |
) |
| 10 |
|
| 11 |
Rcpp::cppFunction( |
| 12 |
depends = 'later', |
| 13 |
includes = ' |
| 14 |
#include <later_api.h> |
| 15 |
', |
| 16 |
code = ' |
| 17 |
int later_h_api_version() { |
| 18 |
return LATER_H_API_VERSION; |
| 19 |
} |
| 20 |
' |
| 21 |
) |
| 22 |
|
| 23 |
expect_identical(later_dll_api_version(), later_h_api_version()) |
| 24 |
}) |
| 25 |
|
| 26 |
test_that("logLevel works", { |
| 27 |
current <- later:::logLevel() |
| 28 |
expect_true(current %in% c("OFF", "ERROR", "WARN", "INFO", "DEBUG")) |
| 29 |
|
| 30 |
previous <- later:::logLevel("DEBUG") |
| 31 |
expect_equal(previous, current) |
| 32 |
expect_equal(later:::logLevel(), "DEBUG") |
| 33 |
|
| 34 |
expect_equal(later:::logLevel(current), "DEBUG") |
| 35 |
expect_equal(later:::logLevel(), current) |
| 36 |
}) |