WIP: netlist browser - removed self test, is unit test now.

This commit is contained in:
Matthias Koefferlein 2019-04-22 22:00:47 +02:00
parent 0410ae765e
commit 46b47ff0d9
2 changed files with 0 additions and 49 deletions

View File

@ -405,44 +405,6 @@ NetlistBrowserModel::circuit_net_device_terminal_other_index_from_id (void *id)
return reinterpret_cast<size_t> (id) - 1;
}
void
NetlistBrowserModel::self_test (const QModelIndex &p)
{
int rows = rowCount (p);
for (int r = 0; r != rows; ++r) {
QModelIndex c, pp;
c = index (r, 0, p);
if (c.column () != 0) {
tl_assert (false);
}
pp = parent (c);
if (pp.isValid () && pp.column () != 0) {
tl_assert (false);
}
if (pp.isValid () && pp.row () != r) {
tl_assert (false);
}
if (pp.isValid () && pp.internalId () != p.internalId ()) {
tl_assert (false);
}
c = index (r, 1, p);
if (c.column () != 1) {
tl_assert (false);
}
pp = parent (c);
if (pp.isValid () && pp.column () != 1) {
tl_assert (false);
}
self_test (c);
}
}
int
NetlistBrowserModel::columnCount (const QModelIndex & /*parent*/) const
{
@ -1061,15 +1023,6 @@ NetlistBrowserPage::set_l2ndb (db::LayoutToNetlist *database)
QAbstractItemModel *tree_model = directory_tree->model ();
NetlistBrowserModel *new_model = new NetlistBrowserModel (this, database);
#if !defined(NDEBUG)
try {
new_model->self_test (); // might throw an exception!
} catch (...) {
delete new_model;
mp_database.reset (0);
throw;
}
#endif
directory_tree->setModel (new_model);
// @@@ connect (directory_tree->selectionModel (), SIGNAL (selectionChanged (const QItemSelection &, const QItemSelection &)), this, SLOT (directory_selection_changed (const QItemSelection &, const QItemSelection &)));

View File

@ -78,8 +78,6 @@ public:
virtual QModelIndex parent (const QModelIndex &index) const;
virtual int rowCount (const QModelIndex &parent) const;
void self_test (const QModelIndex &index = QModelIndex ());
private:
void *make_id_circuit (size_t circuit_index) const;