Skip to content

Commit 5f56209

Browse files
committed
test: add create placeholder test
1 parent 9de7756 commit 5f56209

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/test/c3_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "core/c3_miqp.h"
88
#include "core/c3_qp.h"
9+
#include "core/lcs.h"
910
#include "core/test/c3_cartpole_problem.hpp"
1011

1112
#include "drake/math/discrete_algebraic_riccati_equation.h"
@@ -38,6 +39,7 @@ using namespace c3;
3839
* | UpdateCostMatrix | DONE |
3940
* | Solve | - |
4041
* | SetOsqpSolverOptions | - |
42+
* | CreatePlaceholderLCS | DONE |
4143
* | # of regression tests | 2 |
4244
*
4345
* It also has an E2E test for ensuring the "Solve()" function and other
@@ -332,6 +334,14 @@ TEST_F(C3CartpoleTest, ZSolStaleTest) {
332334
}
333335
}
334336

337+
// Test if CreatePlaceholderLCS works as expected
338+
TEST_F(C3CartpoleTest, CreatePlaceholder) {
339+
// Create a placeholder LCS object
340+
LCS placeholder = LCS::CreatePlaceholderLCS(n, k, m, N, dt);
341+
// Ensure the object is created without any issues
342+
ASSERT_TRUE(placeholder.HasSameDimensionsAs(*pSystem));
343+
}
344+
335345
template <typename T>
336346
class C3CartpoleTypedTest : public testing::Test, public C3CartpoleProblem {
337347
protected:

0 commit comments

Comments
 (0)