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

unittest: Fail with big-edian architecture #526

Closed
wants to merge 1 commit into from

Conversation

LocutusOfBorg
Copy link
Contributor

@LocutusOfBorg LocutusOfBorg commented Aug 22, 2023

Swap some bytes makes it work on ppc64 and s390x

See: #523

…ian safe.

Swap some bytes makes it work on ppc64 and s390x

See: COVESA#523
@minminlittleshrimp
Copy link
Collaborator

Okay let me check the change with s390x/debian on docker
Regards

@minminlittleshrimp minminlittleshrimp self-assigned this Aug 22, 2023
@minminlittleshrimp minminlittleshrimp changed the title For some reasons, gtest_dlt_daemon_gateway.cpp has a test not big end… unittest: Fail with big-edian architecture Aug 22, 2023
@minminlittleshrimp
Copy link
Collaborator

minminlittleshrimp commented Aug 23, 2023

Hello @LocutusOfBorg ,
thanks for your interest in DLT topic.
I could reproduce successfully in my local qemu.
Honestly, I think this FAIL of the test case is understandable, and as you pointed out, yes, it is BYTE_ORDER issue when the author of the test case was not aware of the Big edian case.
See:

#if (BYTE_ORDER == BIG_ENDIAN)

for a reference of message preparation and BIG_EDIAN handling.
I will upload my fix together with an CI/CD for Big Edian check in the future.
Once again thank you so much.
Minh

#if (BYTE_ORDER == BIG_ENDIAN)
count_app_ids = DLT_HTOLE_16(count_app_ids);
count_context_ids = DLT_HTOLE_16(count_context_ids);
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @LocutusOfBorg ,
thanks for the patch but these IDs should not be in little endian when the MSBF bit is set.

I think we need rather a fix in the function dlt_getloginfo_conv_ascii_to_uint16_t() to reflect the endianess of the payload (as indicated by the MSBF bit)

@minminlittleshrimp
Copy link
Collaborator

Close and move discussion to #529

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

Successfully merging this pull request may close these issues.

3 participants