-
Notifications
You must be signed in to change notification settings - Fork 51
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
Feature/refactor set #113
Feature/refactor set #113
Conversation
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
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.
I like, that many code is removed. I will test the code now
Issue 1:
|
expected behavior:
|
issue 2: mqtt publisher does not work any more :( |
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Chen Wenwen (CR/AME5) <wenwen.chen@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Now non-existing paths can not be set anymore. Fresh unittestests still missing.... |
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
try { | ||
database->setSignal(channel, path, request["value"], gen1_compat_mode); | ||
for ( std::tuple<VSSPath,jsoncons::json> setTuple : setPairs) { |
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.
@SebastianSchildt You looped setPairs
three times!
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.
I was (that is what I told myself) going for readability instead of performance and deeper nesting. I hope the datastructure with the vector of tuples thing access compiles down to just moving a pointer, but I do not know 😕
Maybe we add an enhancement issue to look into that 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.
you are right with readability. But in this case, I do not think, that putting everything inside one loop is less readable than using 3 loops. If you like to improve the readability, better refact the method with multiple functions. It is always best practices to have smaller function/method, better than a function with more than 100 lines of code. But If you like, you can create an issue for this, instead of fixing it now.
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.
)"}; | ||
jsoncons::json expectedJson = jsoncons::json::parse(expectedJsonString); | ||
|
||
// run UUT |
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.
what is UUT?
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.
I took the style form the existing tests, i assume "Unit under test"
"kuksa-vss": { | ||
"Vehicle.OBD.*": "rw" | ||
} | ||
} | ||
*/ | ||
string AUTH_TOKE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4MDAsImt1a3NhLXZzcyI6eyJWZWhpY2xlLk9CRC4qIjoicncifX0.U4zpy38DBTx2thPWfOMKALfZovJdkr5xQWDQaGSQo6sMhG-MgDz2UZDvVyRllHiv76f2VmZ2X0TnUZ_Z6yFUmjVYq83LGzUjSDY-xFLLRqOPvFKsQbTmOLbT629uU5Pz2m6x1HcxHBVCxNvI3pZw1D_rHODkVVlgSjycDK5NaHi9EdbSDmccmwk3jI6tPag0eKC7adzBlqkt-h6vqlx_FRz7kjyhiLXmR95QIV3_0MIyq484SsU4ztMPgmHBn1VUWz0x5EW065J2BIavXpaF20oNek0ZzsGcDq-UEQOLPDFoAnYykFrcYmIlXc51wRU2Mw-IIIIs4CV9-Vp1GkQfhQCicmR3OprRepzi_C0Fdh6kwSetAYJWqlVOeo1oUIxFIYbxGFjtdG38dOaacDddBnJ93K8JlnbFdp79Ins39HCmRPit198vdf7gLRcM_GLtvGF6SbT0V2tn17CNt2UxLEniHp7hGybxBVKqgTws2H73ZLe4HEq3UU8vhbeg2V2KXeSXvDJeE3LZvDWARafyHVXrkOx8-O9HqIClfAr-LAl7nnBqq2f9DneW1hjFZOFV5RUCrJ_UpZR_hyEU_aroXO6MNw_MC6KvZeOC6ti1NO6uAB3BYHzpNP1mlyUHlfRl-oLuKZFFqFVBrxY3tBrQwgzfhPZwi427ZIwrNlfv-aU"; |
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.
why this change necessary?
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.
That was an old token (see https://jwt.io/), the old code just never checked it (there are ealier and additional access checks now, in a place that is not mocked in this test unit. as the test already provided a token (albeit it was irrelevant) I replaced it with a validone, so the test goes through)
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
This is work in progress.
Replace old set code with streamlined code supporting "/" paths.
Advanced features such as multiset in a later step, when migrating msg semantic to Gen2