Fix engine_util_sparse_test on MSVC

error C2466: cannot allocate an array of constant size 0

PiperOrigin-RevId: 945988439
Change-Id: Iceb4c536665a4bb42a603a17c41b083a4b6abeea
This commit is contained in:
Yuval Tassa
2026-07-10 18:27:52 -07:00
committed by Copybara-Service
parent d6650f84e5
commit 4a03a61734
+5 -5
View File
@@ -317,13 +317,13 @@ TEST_F(EngineUtilSparseTest, MjuTranspose1by1) {
TEST_F(EngineUtilSparseTest, MjuTransposeNullMatrix) {
// 0 -> 0
mjtNum mat[] = {};
int colind[] = {};
mjtNum* mat = nullptr;
int* colind = nullptr;
int rownnz[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int rowadr[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
mjtNum matT[] = {};
int colindT[] = {};
mjtNum* matT = nullptr;
int* colindT = nullptr;
int rownnzT[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int rowadrT[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
@@ -1272,7 +1272,7 @@ TEST_F(EngineUtilSparseTest, MjuDenseToSparse) {
TEST_F(EngineUtilSparseTest, MergeSorted) {
const int chain1_a[] = {1, 2, 3};
const int chain2_a[] = {};
const int* chain2_a = nullptr;
int merged_a[3];
int n1 = 3;
int n2 = 0;