Skip to content

Commit

Permalink
Daniel/ir tester (#7)
Browse files Browse the repository at this point in the history
* some changes

* Some fixes and changes for compression

* Added some suppressions for valgrind run

* fixes

* Added defaultmodes files

* test
  • Loading branch information
Unreal-Dan authored Nov 30, 2022
1 parent deaf294 commit 5a5e990
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 13 deletions.
1 change: 1 addition & 0 deletions VortexTestingFramework/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ valgrind: vortex_framework
--show-leak-kinds=all \
--track-origins=yes \
--suppressions=valgrind_ncurses_suppressions.supp \
--gen-suppressions=all \
--log-file=valg.out \
./vortex_framework
cat valg.out
Expand Down
13 changes: 3 additions & 10 deletions VortexTestingFramework/TestFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TestFramework::TestFramework() :
m_hwndClickButton(nullptr),
m_hwndTickrateSlider(nullptr),
m_hwndTickOffsetSlider(nullptr),
m_hwndLoadButton(nullptr),
m_hwnd(nullptr),
m_wc(),
m_brightness(255),
Expand Down Expand Up @@ -288,7 +289,7 @@ void TestFramework::paint(HWND hwnd)
RECT stripPos = { (LONG)i, 230, (LONG)i + 1, 250 };
RGBColor col = m_patternStrip[i];
HSVColor hsvCol = col;
uint32_t val = hsvCol.val;
uint32_t val = 255; //hsvCol.val;
// if drawing a color with non full value
if (!col.empty() && val < 255) {
// fill black background
Expand All @@ -297,9 +298,6 @@ void TestFramework::paint(HWND hwnd)
uint32_t offset = (uint32_t)(8 - ((val / 255.0) * 8));
stripPos.top += offset;
stripPos.bottom -= offset;
// replace original color with full value color
hsvCol.val = 255;
col = hsvCol;
}
FillRect(hdc, &stripPos, getBrushCol(col));
}
Expand All @@ -308,12 +306,7 @@ void TestFramework::paint(HWND hwnd)
for (uint32_t i = 0; i < MAX_COLOR_SLOTS; ++i) {
RGBColor curCol = Modes::curMode()->getColorset()->get(i);
HSVColor hsvCol = curCol;
uint32_t val = hsvCol.val;
if (!curCol.empty()) {
hsvCol.val = 255;
}
curCol = hsvCol;
uint32_t offset = (uint32_t)(8 - ((val / 255.0) * 8));
uint32_t offset = (uint32_t)(8 - ((hsvCol.val / 255.0) * 8));
RECT colPos = { 50 + (LONG)(i * 40) , 265, 50 + (LONG)(i * 40) + 20, 285 };
RECT bordPos = colPos;
colPos.left += offset;
Expand Down
2 changes: 1 addition & 1 deletion VortexTestingFramework/VortexEngine
6 changes: 5 additions & 1 deletion VortexTestingFramework/VortexTestingFramework.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<ClCompile Include="TestFramework.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Infrared\IRSender.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Leds\LedStash.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Modes\DefaultModes.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Multi\MateriaPattern.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Multi\Sequencer\ChaserPattern.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Single\DashDopsPattern.cpp" />
Expand Down Expand Up @@ -214,6 +215,7 @@
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Single\TracerPattern.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Multi\Sequencer\Sequence.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Serial\ByteStream.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Serial\Compression.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Serial\Serial.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Storage\Storage.cpp" />
<ClCompile Include="VortexEngine\VortexEngine\src\Time\TimeControl.cpp" />
Expand All @@ -232,6 +234,7 @@
<ClInclude Include="VortexEngine\VortexEngine\src\Infrared\IRSender.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Leds\LedStash.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Leds\LedTypes.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Modes\DefaultModes.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Multi\MateriaPattern.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Multi\Sequencer\ChaserPattern.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Single\DashDopsPattern.h" />
Expand Down Expand Up @@ -296,6 +299,7 @@
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Single\TracerPattern.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Multi\Sequencer\Sequence.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Serial\ByteStream.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Serial\Compression.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Serial\Serial.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Storage\Storage.h" />
<ClInclude Include="VortexEngine\VortexEngine\src\Time\TimeControl.h" />
Expand All @@ -308,4 +312,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
14 changes: 13 additions & 1 deletion VortexTestingFramework/VortexTestingFramework.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@
<ClCompile Include="VortexEngine\VortexEngine\src\Patterns\Single\DashDopsPattern.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VortexEngine\VortexEngine\src\Serial\Compression.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VortexEngine\VortexEngine\src\Modes\DefaultModes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Pattern.h">
Expand Down Expand Up @@ -596,5 +602,11 @@
<ClInclude Include="VortexEngine\VortexEngine\src\Patterns\Single\DashDopsPattern.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="VortexEngine\VortexEngine\src\Serial\Compression.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="VortexEngine\VortexEngine\src\Modes\DefaultModes.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
51 changes: 51 additions & 0 deletions VortexTestingFramework/valgrind_ncurses_suppressions.supp
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,54 @@
fun:_ZN13TestFramework4initEv
fun:main
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:_nc_doalloc
fun:_nc_read_termtype
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_read_entry2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_setupterm
fun:newterm_sp
fun:newterm
fun:initscr
fun:_ZN13TestFramework4initEv
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:_nc_doalloc
fun:_nc_read_termtype
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_read_entry2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_setupterm
fun:newterm_sp
fun:newterm
fun:initscr
fun:_ZN13TestFramework4initEv
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: reachable
fun:realloc
fun:_nc_doalloc
fun:_nc_read_termtype
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_read_entry2
obj:/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
fun:_nc_setupterm
fun:newterm_sp
fun:newterm
fun:initscr
fun:_ZN13TestFramework4initEv
}

0 comments on commit 5a5e990

Please sign in to comment.