forked from mortbopet/Ripes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'config-dialog-ut-refactor-standalone' into 'jumping'
Refactor and add UT for processor config dialog See merge request tfg-riscv-sim/ripes!10
- Loading branch information
Showing
5 changed files
with
75 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <QTest> | ||
#include <qlist.h> | ||
#include <qtestcase.h> | ||
|
||
#include "isainfo.h" | ||
#include "processorregistry.h" | ||
|
||
using namespace Ripes; | ||
|
||
class tst_CPU_Selection : public QObject { | ||
Q_OBJECT | ||
|
||
private slots: | ||
void tst_no_duplicates(); | ||
void tst_no_duplicates_data(); | ||
}; | ||
|
||
void tst_CPU_Selection::tst_no_duplicates_data() { | ||
QTest::addColumn<ISA>("isa"); | ||
QTest::addColumn<ProcessorTags>("tags"); | ||
QTest::addColumn<QList<ProcessorID>>("exp_result"); | ||
|
||
for (const auto &desc : Ripes::ProcessorRegistry::getAvailableProcessors()) { | ||
QList<ProcessorID> id(1, desc.first); | ||
QTest::addRow("%d", desc.first) | ||
<< desc.second->isaInfo().isa->isaID() << desc.second->tags << id; | ||
} | ||
} | ||
|
||
void tst_CPU_Selection::tst_no_duplicates() { | ||
// Check that there aren't any processors with identical tags | ||
// getProcessor should always return a list of length 1 | ||
|
||
QFETCH(ISA, isa); | ||
QFETCH(ProcessorTags, tags); | ||
QFETCH(QList<ProcessorID>, exp_result); | ||
|
||
QCOMPARE(Ripes::ProcessorRegistry::getProcessor(isa, tags), exp_result); | ||
} | ||
|
||
QTEST_APPLESS_MAIN(tst_CPU_Selection) | ||
#include "tst_cpu_selection.moc" |