-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some paths on symbols were not being drawn before #76. This adds a test for that case.
- Loading branch information
1 parent
bb6cc3b
commit 771a46d
Showing
7 changed files
with
46 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
find_package(Qt6 COMPONENTS Widgets Gui Test REQUIRED) | ||
|
||
qt_add_executable(gui_test gui_test.cpp) | ||
add_test(NAME TestGui COMMAND gui_test) | ||
qt_add_executable(mainwindow_test mainwindow_test.cpp) | ||
add_test(NAME TestMainWindow COMMAND mainwindow_test) | ||
|
||
target_link_libraries(gui_test PRIVATE BrdGui Qt::Widgets Qt::Test) | ||
qt_add_executable(brdview_test brdview_test.cpp) | ||
add_test(NAME TestBrdView COMMAND brdview_test) | ||
|
||
target_link_libraries(mainwindow_test PRIVATE BrdGui Qt::Widgets Qt::Test) | ||
target_link_libraries(brdview_test PRIVATE BrdGui Qt::Widgets Qt::Test) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "brdview_test.h" | ||
|
||
#include "brd_gui/brdview.h" | ||
|
||
void TestBrdView::drawAllSymbolPaths() { | ||
BrdView brdview; | ||
|
||
auto parsed_file = parse_file("../../test/data/fmc_tlu/fmc_tlu_v1f_38.brd"); | ||
if (parsed_file) { | ||
brdview.loadFile(&parsed_file.value()); | ||
} | ||
|
||
// Show the appropriate layer | ||
const std::set<std::pair<uint16_t, uint16_t>> layers = {{0x09, 0xFD}}; | ||
brdview.selectLayer(layers); | ||
|
||
// If we don't iterate over all symbol paths, we miss this one. | ||
QVERIFY2(brdview.drewKey(0x000055F6), | ||
"Path unexpectedly missing after selecting its layer"); | ||
} | ||
|
||
QTEST_MAIN(TestBrdView) |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <QTest> | ||
|
||
class TestBrdView : public QObject { | ||
Q_OBJECT | ||
private slots: | ||
void drawAllSymbolPaths(); | ||
}; |
2 changes: 1 addition & 1 deletion
2
src/brd_gui/test/gui_test.cpp → src/brd_gui/test/mainwindow_test.cpp
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,4 +1,4 @@ | ||
#include "gui_test.h" | ||
#include "mainwindow_test.h" | ||
|
||
#include "brd_gui/mainwindow.h" | ||
|
||
|
File renamed without changes.