@@ -294,6 +294,63 @@ void test_ate_echo_control(void)
294294 TEST_ASSERT_TRUE (strstr (response , "OK" ) != NULL );
295295}
296296
297+ /*
298+ * Test: AT#XBOOTINFO=0 - query MCUboot version
299+ * Stub reports firmware version 0, so response should indicate version 0.
300+ */
301+ void test_xbootinfo_version (void )
302+ {
303+ const char * response ;
304+
305+ send_at_command ("AT#XBOOTINFO=0\r\n" );
306+
307+ response = get_captured_response ();
308+ TEST_ASSERT_TRUE (strstr (response , "#XBOOTINFO: 0" ) != NULL );
309+ TEST_ASSERT_TRUE (strstr (response , "OK" ) != NULL );
310+ }
311+
312+ /*
313+ * Test: AT#XBOOTINFO=1 - query active MCUboot slot
314+ * Stub reports S0 active, so response should indicate slot 0.
315+ */
316+ void test_xbootinfo_slot (void )
317+ {
318+ const char * response ;
319+
320+ send_at_command ("AT#XBOOTINFO=1\r\n" );
321+
322+ response = get_captured_response ();
323+ TEST_ASSERT_TRUE (strstr (response , "#XBOOTINFO: 0" ) != NULL );
324+ TEST_ASSERT_TRUE (strstr (response , "OK" ) != NULL );
325+ }
326+
327+ /*
328+ * Test: AT#XBOOTINFO=2 - invalid op, should return error
329+ */
330+ void test_xbootinfo_invalid_op (void )
331+ {
332+ const char * response ;
333+
334+ send_at_command ("AT#XBOOTINFO=2\r\n" );
335+
336+ response = get_captured_response ();
337+ TEST_ASSERT_TRUE (strstr (response , "ERROR" ) != NULL );
338+ }
339+
340+ /*
341+ * Test: AT#XBOOTINFO=? - test command syntax
342+ */
343+ void test_xbootinfo_test (void )
344+ {
345+ const char * response ;
346+
347+ send_at_command ("AT#XBOOTINFO=?\r\n" );
348+
349+ response = get_captured_response ();
350+ TEST_ASSERT_TRUE (strstr (response , "#XBOOTINFO: (0,1)" ) != NULL );
351+ TEST_ASSERT_TRUE (strstr (response , "OK" ) != NULL );
352+ }
353+
297354extern int unity_main (void );
298355
299356int main (void )
0 commit comments