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

PR to issue #143: Assert costumizing #148

Merged

Conversation

willmann9527
Copy link
Contributor

Modifications to set up a proprietary assert function or to disable asserts (empty define).
The code has not been build cause I have no opportunitie to do it, but it should run as usual.

@willmann9527 willmann9527 changed the title Assert costumizing #143 PR to issue #143: Assert costumizing Nov 3, 2020
@willmann9527
Copy link
Contributor Author

Is there any action from my side needed?

@Hadatko
Copy link
Member

Hadatko commented Nov 16, 2020

Is there any action from my side needed?

Sorry currently i don't have time for review and i gues @MichalPrincNXP also. @MichalPrincNXP could you put some estimation here?

@MichalPrincNXP
Copy link
Member

Hello @willmann9527 , I am sorry I am not able to focus on your PR now. Please, give me some time, I will get back to you, OK?

@Hadatko
Copy link
Member

Hadatko commented Jan 2, 2022

Hello, sorry that we didn't focus on your PR for such a long time. I like your solution but currently there are conflicts and redundant imports. Can you update your PR? Sorry once more.

@willmann9527
Copy link
Contributor Author

I fixed it locally but do not have the permission to push. Could you allow me?

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

Hi @willmann9527 we don't have any permission to your branch. You need update your branch and push into your branch same as current one or create new one

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

This is your fork and you are owner of it https://github.com/willmann9527/erpc/tree/Assert_costumizing_%23143

…_#143

# Conflicts:
#	erpc_c/infra/erpc_arbitrated_client_manager.cpp
#	erpc_c/infra/erpc_basic_codec.cpp
#	erpc_c/infra/erpc_client_manager.cpp
#	erpc_c/infra/erpc_framed_transport.cpp
#	erpc_c/infra/erpc_message_buffer.cpp
#	erpc_c/infra/erpc_transport_arbitrator.cpp
#	erpc_c/port/erpc_setup_extensions_freertos.cpp
#	erpc_c/setup/erpc_setup_mbf_dynamic.cpp
#	erpc_c/setup/erpc_setup_mbf_static.cpp
#	erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp
#	erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp
@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

Build didn't pass. Could you try make clean && make all beffore push?
image

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

Build didn't pass. Could you try make clean && make all beffore push?
image

@willmann9527
Copy link
Contributor Author

Where is the project you are running to build the code?

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

@willmann9527 i am not sure what do you mean. For building PR request we are using circleci. Build is triggered automatically and you should be able to see result and details
image

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

i would improve this commit. 639d72a

Better way to implement is add note in configs that this option exists:
all erpc_config.h:
//! @name Assert function definition
//@{
//! User custom asser defition. Include header file if needed before bellow line. If assert is not enabled, default will be used.
// #define erpc_assert(condition)
//@}

And default:
erpc_config_internal.h:
#if !defined(erpc_assert)
#include <cassert>
#define erpc_assert(condition) assert(condition) //!< Assert function.
#endif

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

This is not good change: 973987e

Please read once again my proposal. If you have any question ask me. Thank you ;)

image

@willmann9527
Copy link
Contributor Author

The thing is that I have already replaced all asserts by erpc_assert. In your proposal we are going to get a lot of build errors. In addition, it is not possible to customize the assert. Or do I overlook something?

@willmann9527
Copy link
Contributor Author

erpc_config_internal.h is not included in all these files.

@Hadatko
Copy link
Member

Hadatko commented Jan 26, 2022

@willmann9527 So the thing is that erpc_config.h contains user definition. erpc_config_internal.h is including erpc_config.h and creates default definition for user for variables which were not defined by user in erpc_config.h. So that is the reason why i wrote how it should looks in erpc_config_internal.h (default definition) and input commented code in erpc_config.h. Our proposal will work for most of peaople without noticing change. But your current solution will bring conflicts for all users as they will not have declared erpc_assert variable.

erpc_config_internal.h is included in many files and it can be included trough other includes.... So most of files where you did change doesn't need new include.

erpc_config.h => erpc_config_internal.h => others files

@Hadatko
Copy link
Member

Hadatko commented Jan 27, 2022

@willmann9527 You are almost at the end of this PR. Thank you for your patiente. Now based on my suggestions please remove erpc_config.h includes (they are now even more redundant as before) and include "erpc_config_internal.h" where it has to be (i think only one place which will solve current build fail).

@Hadatko Hadatko assigned Hadatko and unassigned MichalPrincNXP Jan 27, 2022
@Hadatko
Copy link
Member

Hadatko commented Jan 27, 2022

If you switched to section File changes, you will still see a lot of includes you didn't remove. Also there is one more suggestion to replace old assert with new one which you missed:
https://github.com/EmbeddedRPC/erpc/pull/148/files

@Hadatko
Copy link
Member

Hadatko commented Jan 28, 2022

Still around 2 requests to finish this task: https://github.com/EmbeddedRPC/erpc/pull/148/files

@Hadatko
Copy link
Member

Hadatko commented Jan 28, 2022

I hope it is ok i pushed some code into your branch ;) Now i think it is ready to merge. Thank you for your contribution.

Copy link
Member

@Hadatko Hadatko left a comment

Choose a reason for hiding this comment

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

@MichalPrincNXP I am approving this PR based on build result and my review.

erpc_c/infra/erpc_arbitrated_client_manager.cpp Outdated Show resolved Hide resolved
erpc_c/infra/erpc_basic_codec.cpp Outdated Show resolved Hide resolved
erpc_c/infra/erpc_client_manager.cpp Outdated Show resolved Hide resolved
erpc_c/infra/erpc_framed_transport.cpp Outdated Show resolved Hide resolved
erpc_c/infra/erpc_message_buffer.cpp Outdated Show resolved Hide resolved
erpc_c/transports/erpc_inter_thread_buffer_transport.cpp Outdated Show resolved Hide resolved
erpc_c/transports/erpc_rpmsg_linux_transport.cpp Outdated Show resolved Hide resolved
erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp Outdated Show resolved Hide resolved
erpc_c/transports/erpc_rpmsg_tty_rtos_transport.cpp Outdated Show resolved Hide resolved
erpc_c/port/erpc_config_internal.h Outdated Show resolved Hide resolved
@willmann9527
Copy link
Contributor Author

No worries, that is fine.

Copy link
Member

@MichalPrincNXP MichalPrincNXP left a comment

Choose a reason for hiding this comment

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

How about the update of unit test files (test/common folder)? I would replaced assert by erpc_assert here as well.

@Hadatko
Copy link
Member

Hadatko commented Jan 31, 2022

How about the update of unit test files (test/common folder)? I would replaced assert by erpc_assert here as well.

I think i covered them all now.

Copy link
Member

@MichalPrincNXP MichalPrincNXP left a comment

Choose a reason for hiding this comment

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

All tests passed. Thank you for all the effort and the patience!

@MichalPrincNXP MichalPrincNXP merged commit d42a139 into EmbeddedRPC:develop Jan 31, 2022
@Hadatko Hadatko linked an issue Feb 4, 2022 that may be closed by this pull request
@Hadatko Hadatko removed a link to an issue Feb 4, 2022
@Hadatko Hadatko linked an issue Feb 4, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Assert costumizing
3 participants