-
Notifications
You must be signed in to change notification settings - Fork 7
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
✨ (rc): Start BLE + Start Battery Service #508
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
// Leka - LekaOS | ||
// Copyright 2022 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "RobotController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
est-ce qu'on peut pas le faire dans le constructeur? plutôt que d'appeler une fonction qu'on peut oublier d'appeler ? ou alors le ctor appelle la fonction privée
initializeComponents
.je me pose la même question pour
registerEvents
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.
On a déjà eu dans le passé des cas où le constructeur qui devait appeler des méthodes privées ne le faisait pas à l'exécution. On peut reprendre le pari d'essayer.
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.
on se souvient desquels et de pourquoi ça marchait pas?
ça serait intéressant de comprendre pourquoi, s'il fallait modifier un truc de notre côté ou si c'est "comme ça".
si pas le choix, on vivra avec. mais si c'est possible, ça rend l'interface et l'utilisation beaucoup plus simple et propre.
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.
Je vais essayer de reproduire le phénomène
On avait pris le parti d'être explicite et d'appeler les méthodes qui fallait plutôt qu'implicite comme pourrait l'être un nom de méthode générique
init();
Il peut y avoir une réponse du côté de
most vexing parse
[Source 1] [Source 2]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.
Après, c'est aussi pour les tests: c'est plus simple de focaliser sur ce qu'on attend de chaque fonctions au lieu d'avoir tous les appels et de devoir faire un
EXPECT_CALL
pour les unexpected callsOn peut les garder sous forme de fonctions, mais ça peut prêter à confusion d'avoir des fonctions publique qu'on appelle pas dans l'exécution du programme et uniquement en test
Edit. En fait c'est aussi le cas pour toutes les autres méthodes de
RobotController
, des méthodes qui ne sont appelées que par les tests et pas dans lemain.cpp
. Donc ça ne gênera pas d'avoir des méthodes publiques non appelé dansmain.cpp
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.
Aussi, il semblerait que les tests soient aussi cassés
Même si les
EXPECT_CALL
sont définis, ils ne sont pas bien pris en compte à l'exécution des tests et on se retrouve avec 2 types d'erreurs: d'un côté il y a des uninterresting calls et de l'autre des EXPECTED_CALL qui ne sont pas appelés.Je vais voir s'il y a quelque chose à faire, dans ce cas je supprimerai ce commentaire
Edit. J'ai une solution, mais elle n'est pas très "propre" puisqu'elle impose 2 lignes supplémentaires dans chaque test.