Closed akmal-threepointsix closed 11 months ago
Hi, thanks for your work - again! So two things I've noted here...
src/tests
again? You've moved them out and put them into the "regular" code. Do not worry, if you won't do it I'll clean that up :wink: After you put so much work into it to re-submit this PR I'll absolutely make sure to get it merged this time. This is the next thing going in - so I'll not allow this to run out-of-sync again! Hehe...
P.S. There is so much code, I'll try to dive deeper into it at a later date - for now I also have too much of my own work going on...
- Meh - le pipeline is failing...
Fixed (hopefully) by pushing ImGui Test Engine submodule folder
- Could you reorder the code to bundle all the unit/ui/helpers stuff for testing under
src/tests
again? You've moved them out and put them into the "regular" code. Do not worry, if you won't do it I'll clean that up π
Done. I forgot about this one :)
p.s: in my last PR it wasn't your fault, we were playing with rebases and the situation got out of hand :) Old commits were rebased and git thought they were new commits, because their hash was different. At least I think that's what happened... Anyway, it was too painful to fix...
Ok, I also removed reinterpret_cast
from tests/helpers/TestDrawer.h
.
It turned out, that OswAppV1
and OswApp
are the same class, so I can simply static_cast
timer and alarm from OswAppV1
to OswAppTimer
and OswAppAlarm
respectively, because they are inherited from OswApp
@akmal-threepointsix If you formulate that like this... Ever thought about the more safe variant of https://en.cppreference.com/w/cpp/language/dynamic_cast ? This also ensures you won't cast in the future if we break it :wink:
Yes, sure, dynamic_cast
is also a valid option and safer one. However, it introduces some run-time overhead, which in this case seemed unnecessary to me. On the other hand, you are right, in future someone might change codebase and static_cast
will silently fail, so it would be better to use dynamic_cast
. I believe, run-time cost is insignificant, especially since it is in emulator & UI tests environment, not in production.
@akmal-threepointsix If you formulate that like this... Ever thought about the more safe variant of https://en.cppreference.com/w/cpp/language/dynamic_cast ? This also ensures you won't cast in the future if we break it π
Ok, done. Changed static_cast
to dynamic_cast
and added assert
to confirm that casting was successful and didn't return nullptr
Since this old PR #351 diverged too much from the up-to-date develop branch, I decided to create a new branch from the develop and open this new PR.
These changes are basically the same as in PR #351:
CMakeLists.txt
,emulator/lib/ImGUI_TestEngine
). IMPORTANT: since I added new submodule, you need to run$ git submodule update --init --recursive
after checkout to this branchemulator/lib/ImGUI
)emulator/src/UiTests/OswAppAlarm.cpp
,emulator/src/UiTests/OswAppTimer.cpp
)README.md
with new testing chapteremulator/include/Emulator.hpp
,include/apps/OswAppDrawer.h
andinclude/apps/OswAppV2Compat.h
)And some NEW changes:
UiTest_main.hpp
, I added some code to skip tutorial, if emulator was launched with--ui_tests
option