Skip to content

Instantly share code, notes, and snippets.

@DouglasSherk
Created April 18, 2017 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DouglasSherk/755b2caa92a23b272335fc0a4110269d to your computer and use it in GitHub Desktop.
Save DouglasSherk/755b2caa92a23b272335fc0a4110269d to your computer and use it in GitHub Desktop.
A test case for the ArrayX API.
testLotsOfData() {
new array = array_create()
for (int i = 0; i < 1000000; i++) {
array_set_int(array, 0, 1)
/**
* What? This was segfaulting after some large i, usually ~:
* 100000 < i < 500000
*/
array_delete(array, 0)
}
if (!array_isempty(array)) {
console_print(0, "[TEST] [ArrayX] Test case 'testLotsOfData' failed: !array_isempty()")
return false
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment