for (int i = 0; i < 3; ++i) { // Fill out rest of axis
test[6 + i * 3 + 0] = Cross(test[i], test[0]);
test[6 + i * 3 + 1] = Cross(test[i], test[1]);
test[6 + i * 3 + 2] = Cross(test[i], test[2]);
}
for (int i = 0; i < 3; ++i) { // Fill out rest of axis
test[6 + i * 3 + 0] = Cross(test[i], test[3]);
test[6 + i * 3 + 1] = Cross(test[i], test[4]);
test[6 + i * 3 + 2] = Cross(test[i], test[5]);
}
https://github.com/gszauer/GamePhysicsCookbook/blob/a0b8ee0c39fed6d4b90bb6d2195004dfcf5a1115/Code/Geometry3D.cpp#L506C1-L510C3
If I understood everything correctly, the code should look like this