[consider merging] OASIS Reader: error on duplicate CELLNAMEs

This commit is contained in:
Matthias Koefferlein 2024-02-10 18:18:13 +01:00
parent 58032a5d5a
commit 5d74a5e8c6
3 changed files with 22 additions and 0 deletions

View File

@ -154,6 +154,10 @@ CommonReaderBase::rename_cell (db::Layout &layout, size_t id, const std::string
common_reader_error (tl::sprintf (tl::to_string (tr ("Cell named %s with ID %ld was already given name %s")), cn, id, iid->second.first));
}
if (iname != m_name_map.end () && iname->second.first != null_id && iname->second.first != id) {
common_reader_error (tl::sprintf (tl::to_string (tr ("Same cell name %s, but different IDs: %ld and %ld")), cn, id, iname->second.first));
}
if (iid != m_id_map.end () && iname != m_name_map.end ()) {
if (iname->second.second != iid->second.second) {

View File

@ -599,3 +599,21 @@ TEST(Bug_1474)
EXPECT_EQ (ex.msg (), "Cell named ADDHX2 with ID 4 was already given name SEDFFTRX2 (position=763169, cell=)");
}
}
TEST(DuplicateCellname)
{
db::Manager m (false);
db::Layout layout (&m);
try {
tl::InputStream file (tl::testdata () + "/oasis/duplicate_cellname.oas");
db::OASISReader reader (file);
reader.read (layout);
EXPECT_EQ (false, true);
} catch (tl::CancelException &ex) {
// Seen when private test data is not installed
throw;
} catch (tl::Exception &ex) {
EXPECT_EQ (ex.msg (), "Same cell name TOP, but different IDs: 3 and 0 (position=1070, cell=)");
}
}

BIN
testdata/oasis/duplicate_cellname.oas vendored Normal file

Binary file not shown.