Skip to content
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

Test Constraint::more_complex_custom_constraint_function fails on s390x arch #227

Open
souryogurt opened this issue May 11, 2020 · 3 comments
Labels

Comments

@souryogurt
Copy link
Contributor

I trying to build and test Cgreen on alternative architectures supported in Fedora,
It seams the test for more_complex_custom_constraint_function fails on s390x architecture.
Test:

Ensure(CustomConstraint, more_complex_custom_constraint_function) {
Box box1 = {.id = 1, .size = 5};
Piece piece99 = {.id = 99, .size = 6};
assert_that(&piece99, can_fit_in_box(&box1));
}

Steps to reproduce

Actually I building using koji service that has s390x environment, so not sure how to reproduce it on x86 arch :/

Actual result

Comparing output of custom_constraint_messages_tests to expected: 
*** custom_constraint_messages_tests.output.normalized	Mon May 11 19:16:28 2020
--- /builddir/build/BUILD/cgreen-1.2.0/tests/custom_constraint_messages_tests.expected	Thu Aug  8 19:49:09 2019
***************
*** 7,13 ****
  
  custom_constraint_messages_tests.c: Failure: CustomConstraint -> more_complex_custom_constraint_function 
  	Expected [&piece99] to [fit in box] [&box1]
! 		at offset:			[3]
  			actual value:		[0x63]
  			expected value:		[0x01]
  
--- 7,13 ----
  
  custom_constraint_messages_tests.c: Failure: CustomConstraint -> more_complex_custom_constraint_function 
  	Expected [&piece99] to [fit in box] [&box1]
! 		at offset:			[0]
  			actual value:		[0x63]
  			expected value:		[0x01]
@souryogurt
Copy link
Contributor Author

I'm not sure but seams its related to big-endianness of s390x and #226

@thoni56
Copy link
Contributor

thoni56 commented May 11, 2020

Yes. This is the same cause, you can see the difference in offset. I just added a more detailed description of the problem in #226.

But it points out that the tests, as they are now, don't work on big-endians. Cgreen works correctly it seems, but the tests of the text reporter output can't factor in the endian-ness.

@souryogurt
Copy link
Contributor Author

souryogurt commented Nov 14, 2020

Just checked @alvinchchen patch. I am confirming that the issue is fixed. So the issue can be closed.

Build with 9768d33 and #241 patches succeseed on all architectures:
https://koji.fedoraproject.org/koji/taskinfo?taskID=55602746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants