-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Secure Cell corruption tests on i386 #408
Conversation
It turned out that current tests do not work on i386 architecture (32-bit x86). This is because we try allocating ~0xDEADBEEF bytes which is not possible in 32-bit userland that typically has a limit of 2 or 3 GB of user memory. The constant we use does not really matter but should be distinct enough. Use something smaller instead.
copy-paste 6 times one value not good. what about to declare it as |
It's not the 'same' value so I think we don't need to have a named constant for it. It just happens to be the same in all these places because I'm too lazy to invent different values for each test, but they work fine with different values. These are really arbitrary values (well, as long as they are less that 231). My preference for tests is to keep individual tests independent of each other, allow some redundancy and avoid abstraction unless it improves readability, especially for test inputs and outputs. For example, when testing encryption I'd rather see That's why I'm not cringing at what looks like blatant violation of DRY principle here. I don't remember where exactly I picked this up, but this post summarizes its nicely. |
my suggest to use one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
It turned out that current tests do not work on i386 architecture (32-bit x86). This is because we try allocating ~0xDEADBEEF bytes which is not possible in 32-bit userland that typically has a limit of 2 or 3 GB of user memory. The constant we use does not really matter but should be distinct enough. Use something smaller instead.