Skip to content

I'm having trouble making sense of parameterized strings. #479

Answered by Snaipe
saladuit asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, this is a result of the addresses space changing between the parent (where ParameterizedTestParameters runs) and the child (where the test runs). Any pointer value defined there, including strings, end up messed up, likely because of the ASLR.

The canonical way of passing pointer values is to use cr_malloc to ensure the strings get moved from the parent to the child's virtual address space. See

/* Using strings in parameterized tests */
for an actual example.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@saladuit
Comment options

@saladuit
Comment options

Answer selected by saladuit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants