ice40: Initialize context pointer in tests (#1568)

If the chipdb is not found, the Setup() call throws, but GTest still calls
TearDown, which then stumbles over the uninitialized pointer.

This makes the tests fail without valgrind errors or segfaults at least.
This commit is contained in:
Simon Richter 2025-10-06 16:12:32 +09:00 committed by GitHub
parent e7f9060efb
commit 5d45520bb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ class HX1KTest : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(HX1KTest, bel_names)

View File

@ -37,7 +37,7 @@ class HX8KTest : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(HX8KTest, bel_names)

View File

@ -37,7 +37,7 @@ class LP1KTest : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(LP1KTest, bel_names)

View File

@ -37,7 +37,7 @@ class LP384Test : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(LP384Test, bel_names)

View File

@ -37,7 +37,7 @@ class LP8KTest : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(LP8KTest, bel_names)

View File

@ -37,7 +37,7 @@ class UP5KTest : public ::testing::Test
virtual void TearDown() { delete ctx; }
ArchArgs chipArgs;
Context *ctx;
Context *ctx = nullptr;
};
TEST_F(UP5KTest, bel_names)