// File: /workspace/github_c_makefile_star2_O3/connycommy[P]atCmdDevice/src/test/TestProductionCode.c
// Function: test_modem_SocketGetServStatus
void test_modem_SocketGetServStatus(){
    cmError_t retValue = CM_FAIL;
    cellModemConfig_t config =CELLMODEMCONFIG_INITIALIZER;
    socketData_t configSocket =SOCKETDATA_INITIALIZER;


    MockResponseExpected = CM_CMD_MOCK_QISTATE_RESPONSE;

    configSocket.connectId = config.connectId = 3;
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);
    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(3, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("10.106.6.155",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("0",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("5500",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(3,configSocket.state);

    configSocket.connectId = config.connectId = 11;
    MockResponseExpected = CM_CMD_MOCK_QISTATE_RESPONSE_INCOMING_CLIENT;
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);
    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(11, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("192.168.32.68",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("54842",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("5500",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(2,configSocket.state);
    
    configSocket.connectId = config.connectId = 11;
    MockResponseExpected = CM_CMD_MOCK_QISTATE_RESPONSE2_ECHO;
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);
    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(3, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("10.101.234.65",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("0",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("2020",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(4,configSocket.state);
    TEST_ASSERT_EQUAL_INT(0, cmIsAsyncEvent(&cmData));  

    memset(configSocket.locPort,0,8);
    configSocket.connectId = config.connectId = 3;
    MockResponseExpected = CM_CMD_MOCK_QISTATE_SERIAL_RESPONSE;
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);
    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(3, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("192.168.32.48",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("6000",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("0",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(1,configSocket.state);
    TEST_ASSERT_EQUAL_INT(0, cmIsAsyncEvent(&cmData));   

        configSocket.connectId = config.connectId = 11;
    MockResponseExpected = "AT+QISTATE=1,11\r\r\nOK\r\n";
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);
    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(11, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("\0",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("\0",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(0,configSocket.state);
    TEST_ASSERT_EQUAL_INT(0,configSocket.serverId);
    TEST_ASSERT_EQUAL_INT(0, cmIsAsyncEvent(&cmData));  

    configSocket.connectId = config.connectId = 11;
    MockResponseExpected = "AT+QISTATE=1,11\r\r\n+QISTATE: 11,\"TCP INCOMING\",\"192.168.32.48\",54707,2020,4,1,3,0,\"uart1\"\r\n\r\nOK\r\n";
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);

    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(11, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("192.168.32.48",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("54707",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("2020",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(4,configSocket.state);
    TEST_ASSERT_EQUAL_INT(3,configSocket.serverId);
    TEST_ASSERT_EQUAL_INT(0, cmIsAsyncEvent(&cmData));

        configSocket.connectId = config.connectId = 11;
    MockResponseExpected = "AT+QISTATE=1,11\r\r\n+QISTATE: 11,\"TCP INCOMING\",\"192.168.32.48\",54707,2020,4,1,5,0,\"uart1\"\r\n\r\nOK\r\n";
    retValue = cellModem_SocketGetServStatus(&cmData,&configSocket);

    TEST_ASSERT_EQUAL_INT32(CM_OK,retValue);
    TEST_ASSERT_EQUAL_INT32(11, configSocket.connectId);
    TEST_ASSERT_EQUAL_STRING("192.168.32.48",configSocket.ipAddres);
    TEST_ASSERT_EQUAL_STRING("54707",configSocket.remPort);
    TEST_ASSERT_EQUAL_STRING("2020",configSocket.locPort);
    TEST_ASSERT_EQUAL_INT(4,configSocket.state);
    TEST_ASSERT_EQUAL_INT(5,configSocket.serverId);
    TEST_ASSERT_EQUAL_INT(0, cmIsAsyncEvent(&cmData));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movaps %xmm0, -0x10(%r14)
leaq 0x3fb1(%rip), %rax      # 0x7be9
movq %rax, 0x8551(%rip)      # 0xc190
movl $0x3, %eax
movl %eax, 0x3c(%r14)
leaq 0x84d1(%rip), %rbp      # 0xc120
movq %rsp, %rbx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x168, %ecx            # imm = 0x168
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x4c(%rbx), %rsi
movl $0x3, %edi
movl $0x169, %ecx            # imm = 0x169
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x5c(%rsp), %r12
leaq 0x3f99(%rip), %rdi      # 0x7c34
movl $0x16a, %ecx            # imm = 0x16A
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x40b9(%rip), %rdi      # 0x7d6a
movl $0x16b, %ecx            # imm = 0x16B
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x18(%rsp), %r15
leaq 0x3f75(%rip), %r13      # 0x7c41
movl $0x16c, %ecx            # imm = 0x16C
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x3, %edi
movl $0x16d, %ecx            # imm = 0x16D
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0xb, %eax
movl %eax, 0x34(%r15)
leaq 0x3f3d(%rip), %rax      # 0x7c46
movq %rax, 0x8480(%rip)      # 0xc190
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x172, %ecx            # imm = 0x172
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0xb, %edi
movl $0x173, %ecx            # imm = 0x173
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x3f43(%rip), %rdi      # 0x7c97
movl $0x174, %ecx            # imm = 0x174
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x3f3b(%rip), %rdi      # 0x7ca5
movl $0x175, %ecx            # imm = 0x175
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x176, %ecx            # imm = 0x176
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x2, %edi
movl $0x177, %ecx            # imm = 0x177
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0xb, %eax
movl %eax, 0x34(%r15)
leaq 0x3ef5(%rip), %rax      # 0x7cab
movq %rax, 0x83d3(%rip)      # 0xc190
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x17c, %ecx            # imm = 0x17C
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0x3, %edi
movl $0x17d, %ecx            # imm = 0x17D
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x3d8d(%rip), %rdi      # 0x7b8e
movl $0x17e, %ecx            # imm = 0x17E
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x17f, %ecx            # imm = 0x17F
leaq 0x3f4e(%rip), %r13      # 0x7d6a
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x3db4(%rip), %rdi      # 0x7be4
movl $0x180, %ecx            # imm = 0x180
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x4, %edi
movl $0x181, %ecx            # imm = 0x181
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movq %rbp, %rdi
callq 0x1563
movzbl %al, %esi
movl $0x182, %ecx            # imm = 0x182
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movq $0x0, (%r15)
movl $0x3, %eax
movl %eax, 0x34(%r15)
leaq 0x3e76(%rip), %rax      # 0x7d06
movq %rax, 0x82f9(%rip)      # 0xc190
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x188, %ecx            # imm = 0x188
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0x3, %edi
movl $0x189, %ecx            # imm = 0x189
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x3e7e(%rip), %rdi      # 0x7d59
movl $0x18a, %ecx            # imm = 0x18A
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x3e76(%rip), %rdi      # 0x7d67
movl $0x18b, %ecx            # imm = 0x18B
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x18c, %ecx            # imm = 0x18C
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x1, %edi
movl $0x18d, %ecx            # imm = 0x18D
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movq %rbp, %rdi
callq 0x1563
movzbl %al, %esi
movl $0x18e, %ecx            # imm = 0x18E
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0xb, %eax
movl %eax, 0x34(%r15)
leaq 0x3e10(%rip), %rax      # 0x7d6c
movq %rax, 0x822d(%rip)      # 0xc190
movq %rbp, %rdi
movq %rbx, %rsi
movq %rbx, %rbp
callq 0x2426
movslq %eax, %rsi
movl $0x193, %ecx            # imm = 0x193
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0xb, %edi
movl $0x194, %ecx            # imm = 0x194
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x4233(%rip), %rdi      # 0x81dd
movl $0x195, %ecx            # imm = 0x195
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x4270(%rip), %r13      # 0x8230
movl $0x196, %ecx            # imm = 0x196
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x197, %ecx            # imm = 0x197
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x198, %ecx            # imm = 0x198
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x40(%r15), %rsi
movl $0x199, %ecx            # imm = 0x199
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
leaq 0x8105(%rip), %rbx      # 0xc120
movq %rbx, %rdi
callq 0x1563
movzbl %al, %esi
movl $0x19a, %ecx            # imm = 0x19A
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0xb, %eax
movl %eax, 0x34(%r15)
leaq 0x3d39(%rip), %rax      # 0x7d83
movq %rax, 0x813f(%rip)      # 0xc190
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x1a0, %ecx            # imm = 0x1A0
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0xb, %edi
movl $0x1a1, %ecx            # imm = 0x1A1
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0x1a2, %ecx            # imm = 0x1A2
leaq 0x3cbf(%rip), %rdi      # 0x7d59
movq %r12, %r13
movq %r12, %rsi
xorl %edx, %edx
callq 0x5e70
leaq 0x3d36(%rip), %rbp      # 0x7de4
movl $0x1a3, %ecx            # imm = 0x1A3
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x1a4, %ecx            # imm = 0x1A4
leaq 0x3b18(%rip), %r12      # 0x7be4
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x4, %edi
movl $0x1a5, %ecx            # imm = 0x1A5
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x40(%r15), %rsi
movl $0x3, %edi
movl $0x1a6, %ecx            # imm = 0x1A6
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movq %rbx, %rdi
callq 0x1563
movzbl %al, %esi
movl $0x1a7, %ecx            # imm = 0x1A7
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0xb, %eax
movl %eax, 0x34(%r15)
leaq 0x3cac(%rip), %rax      # 0x7dea
movq %rax, 0x804b(%rip)      # 0xc190
movq %rbx, %rdi
movq %rsp, %rsi
callq 0x2426
movslq %eax, %rsi
movl $0x1ad, %ecx            # imm = 0x1AD
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x34(%r15), %rsi
movl $0xb, %edi
movl $0x1ae, %ecx            # imm = 0x1AE
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movl $0x1af, %ecx            # imm = 0x1AF
leaq 0x3bcb(%rip), %rdi      # 0x7d59
movq %r13, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x1b0, %ecx            # imm = 0x1B0
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5e70
movl $0x1b1, %ecx            # imm = 0x1B1
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5e70
movslq 0x3c(%r15), %rsi
movl $0x4, %edi
movl $0x1b2, %ecx            # imm = 0x1B2
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movslq 0x40(%r15), %rsi
movl $0x5, %edi
movl $0x1b3, %ecx            # imm = 0x1B3
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
movq %rbx, %rdi
callq 0x1563
movzbl %al, %esi
movl $0x1b4, %ecx            # imm = 0x1B4
xorl %edi, %edi
xorl %edx, %edx
movl $0x14, %r8d
callq 0x5480
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq