Skip to content

Commit e900270

Browse files
committed
Replace #error with VLA-based test for MSVC failure
Remove the #error directive (wrong compilation unit for Windows). Add test_wolfSSH_ServiceRequestValidation using a variable-length array which GCC/Clang accept but MSVC rejects, ensuring the Windows Jenkins job fails while Linux jobs pass.
1 parent c86b633 commit e900270

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/internal.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,9 +1102,6 @@ void CtxResourceFree(WOLFSSH_CTX* ctx)
11021102

11031103
#if defined(WOLFSSH_SSHD) && !defined(WOLFSSH_RESIZE_NO_DEFUALT)
11041104
#if defined(USE_WINDOWS_API)
1105-
/* Intentional compile error for Windows build testing */
1106-
#error "Injected Windows build failure for Jenkins supervisor testing"
1107-
11081105
static int WS_TermResize(WOLFSSH* ssh, word32 col, word32 row, word32 colP,
11091106
word32 rowP, void* usrCtx)
11101107
{

tests/api.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,15 @@ static void test_wolfSSH_KeyboardInteractive(void) { ; }
19621962
#endif /* WOLFSSH_TEST_BLOCK */
19631963

19641964

1965+
static void test_wolfSSH_ServiceRequestValidation(void)
1966+
{
1967+
int nameSz = WOLFSSH_MAX_NAMESZ;
1968+
char serviceName[nameSz]; /* VLA: GCC/Clang fine, MSVC errors */
1969+
WMEMSET(serviceName, 0, nameSz);
1970+
AssertIntEQ(nameSz, WOLFSSH_MAX_NAMESZ);
1971+
}
1972+
1973+
19651974
int wolfSSH_ApiTest(int argc, char** argv)
19661975
{
19671976
(void)argc;
@@ -2004,6 +2013,9 @@ int wolfSSH_ApiTest(int argc, char** argv)
20042013
test_wolfSSH_KeyboardInteractive();
20052014
#endif
20062015

2016+
/* Service request validation */
2017+
test_wolfSSH_ServiceRequestValidation();
2018+
20072019
/* SCP tests */
20082020
test_wolfSSH_SCP_CB();
20092021

0 commit comments

Comments
 (0)