1111#include < vector>
1212
1313#include " gtest/gtest.h"
14- #include " nangate45_test_fixture.h"
1514#include " odb/db.h"
1615#include " odb/dbSet.h"
1716#include " odb/defin.h"
1817#include " odb/geom.h"
18+ #include " tst/nangate45_fixture.h"
1919#include " utl/Logger.h"
2020
2121namespace odb {
2222
23- TEST_F (Nangate45TestFixture , PolygonalFloorplanCreatesBlockagesInNegativeSpace)
23+ TEST_F (Nangate45Fixture , PolygonalFloorplanCreatesBlockagesInNegativeSpace)
2424{
25- // Arrange
26- dbChip* chip = dbChip::create (db_.get (), lib_->getTech ());
27- dbBlock* block = dbBlock::create (chip, " block" );
28-
2925 // Act
3026 Polygon area ({{0 , 0 },
3127 {0 , 300000 },
@@ -34,11 +30,11 @@ TEST_F(Nangate45TestFixture, PolygonalFloorplanCreatesBlockagesInNegativeSpace)
3430 {300000 , 150000 },
3531 {300000 , 0 }});
3632
37- block ->setDieArea (area);
33+ block_ ->setDieArea (area);
3834
3935 // Assert that there is one virtual blockage for this floorplan.
4036 // There's essentially 1 rectangle cut out of it.
41- dbSet<dbBlockage> blockages = block ->getBlockages ();
37+ dbSet<dbBlockage> blockages = block_ ->getBlockages ();
4238 std::vector<dbBlockage*> virtual_blockages;
4339 for (dbBlockage* blockage : blockages) {
4440 if (!blockage->isSystemReserved ()) {
@@ -52,7 +48,7 @@ TEST_F(Nangate45TestFixture, PolygonalFloorplanCreatesBlockagesInNegativeSpace)
5248
5349 // 1 obstruction for each via and metal layer in Nangate 45
5450 // should be 21 including poly layers.
55- dbSet<dbObstruction> obstructions = block ->getObstructions ();
51+ dbSet<dbObstruction> obstructions = block_ ->getObstructions ();
5652 std::vector<dbObstruction*> virtual_obstructions;
5753 for (dbObstruction* obstruction : obstructions) {
5854 if (!obstruction->isSystemReserved ()) {
@@ -65,20 +61,16 @@ TEST_F(Nangate45TestFixture, PolygonalFloorplanCreatesBlockagesInNegativeSpace)
6561 EXPECT_EQ (virtual_obstructions.size (), 21 );
6662}
6763
68- TEST_F (Nangate45TestFixture , SettingTheFloorplanTwiceClearsSystemBlockages)
64+ TEST_F (Nangate45Fixture , SettingTheFloorplanTwiceClearsSystemBlockages)
6965{
70- // Arrange
71- dbChip* chip = dbChip::create (db_.get (), lib_->getTech ());
72- dbBlock* block = dbBlock::create (chip, " block" );
73-
7466 // Act
7567 Polygon area ({{0 , 0 },
7668 {0 , 300000 },
7769 {400000 , 300000 },
7870 {400000 , 150000 },
7971 {300000 , 150000 },
8072 {300000 , 0 }});
81- block ->setDieArea (area);
73+ block_ ->setDieArea (area);
8274
8375 odb::Polygon new_die_area ({{0 , 0 },
8476 {0 , 300000 },
@@ -87,11 +79,11 @@ TEST_F(Nangate45TestFixture, SettingTheFloorplanTwiceClearsSystemBlockages)
8779 {300000 , 160000 },
8880 {300000 , 0 }});
8981
90- block ->setDieArea (new_die_area);
82+ block_ ->setDieArea (new_die_area);
9183
9284 // Assert that there is one virtual blockage for this floorplan.
9385 // There's essentially 1 rectangle cut out of it.
94- dbSet<dbBlockage> blockages = block ->getBlockages ();
86+ dbSet<dbBlockage> blockages = block_ ->getBlockages ();
9587 std::vector<dbBlockage*> virtual_blockages;
9688 for (dbBlockage* blockage : blockages) {
9789 if (!blockage->isSystemReserved ()) {
@@ -105,7 +97,7 @@ TEST_F(Nangate45TestFixture, SettingTheFloorplanTwiceClearsSystemBlockages)
10597
10698 // 1 obstruction for each via and metal layer in Nangate 45
10799 // should be 21 including poly layers.
108- dbSet<dbObstruction> obstructions = block ->getObstructions ();
100+ dbSet<dbObstruction> obstructions = block_ ->getObstructions ();
109101 std::vector<dbObstruction*> virtual_obstructions;
110102 for (dbObstruction* obstruction : obstructions) {
111103 if (!obstruction->isSystemReserved ()) {
@@ -118,24 +110,21 @@ TEST_F(Nangate45TestFixture, SettingTheFloorplanTwiceClearsSystemBlockages)
118110 EXPECT_EQ (virtual_obstructions.size (), 21 );
119111}
120112
121- TEST_F (Nangate45TestFixture , DeletingSystemBlockagesThrows)
113+ TEST_F (Nangate45Fixture , DeletingSystemBlockagesThrows)
122114{
123115 // Arrange
124- dbChip* chip = dbChip::create (db_.get (), lib_->getTech ());
125- dbBlock* block = dbBlock::create (chip, " block" );
126-
127116 Polygon area ({{0 , 0 },
128117 {0 , 300000 },
129118 {400000 , 300000 },
130119 {400000 , 150000 },
131120 {300000 , 150000 },
132121 {300000 , 0 }});
133122
134- block ->setDieArea (area);
123+ block_ ->setDieArea (area);
135124
136125 // Assert that there is one virtual blockage for this floorplan.
137126 // There's essentially 1 rectangle cut out of it.
138- dbSet<dbBlockage> blockages = block ->getBlockages ();
127+ dbSet<dbBlockage> blockages = block_ ->getBlockages ();
139128 std::vector<dbBlockage*> virtual_blockages;
140129 for (dbBlockage* blockage : blockages) {
141130 if (!blockage->isSystemReserved ()) {
@@ -150,24 +139,21 @@ TEST_F(Nangate45TestFixture, DeletingSystemBlockagesThrows)
150139 { dbBlockage::destroy (virtual_blockages[0 ]); }, std::runtime_error);
151140}
152141
153- TEST_F (Nangate45TestFixture , DeletingSystemObstructionsThrows)
142+ TEST_F (Nangate45Fixture , DeletingSystemObstructionsThrows)
154143{
155144 // Arrange
156- dbChip* chip = dbChip::create (db_.get (), lib_->getTech ());
157- dbBlock* block = dbBlock::create (chip, " block" );
158-
159145 Polygon area ({{0 , 0 },
160146 {0 , 300000 },
161147 {400000 , 300000 },
162148 {400000 , 150000 },
163149 {300000 , 150000 },
164150 {300000 , 0 }});
165151
166- block ->setDieArea (area);
152+ block_ ->setDieArea (area);
167153
168154 // Assert that there is one virtual blockage for this floorplan.
169155 // There's essentially 1 rectangle cut out of it.
170- dbSet<dbObstruction> obstructions = block ->getObstructions ();
156+ dbSet<dbObstruction> obstructions = block_ ->getObstructions ();
171157 std::vector<dbObstruction*> virtual_obstructions;
172158 for (dbObstruction* obstruction : obstructions) {
173159 if (!obstruction->isSystemReserved ()) {
0 commit comments