// File: /workspace/github_c_makefile_star2_O2/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), %rbp
movaps %xmm0, 0x30(%rbp)
movaps %xmm0, 0x50(%rbp)
movaps %xmm0, 0x40(%rbp)
movaps %xmm0, 0x20(%rbp)
movaps %xmm0, 0x10(%rbp)
movaps %xmm0, (%rbp)
movaps %xmm0, -0x10(%rbp)
leaq 0x411f(%rip), %rax      # 0x7bc9
movq %rax, 0x96df(%rip)      # 0xd190
pushq $0x3
popq %rax
movl %eax, 0x3c(%rbp)
leaq 0x9662(%rip), %rdi      # 0xd120
movq %rsp, %r14
movq %r14, %rsi
callq 0x237e
movslq %eax, %rsi
pushq $0x14
popq %rbx
movl $0x168, %ecx            # imm = 0x168
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x4c(%r14), %rsi
pushq $0x3
popq %r15
movl $0x169, %ecx            # imm = 0x169
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x5c(%rsp), %r13
leaq 0x410e(%rip), %rdi      # 0x7c14
movl $0x16a, %ecx            # imm = 0x16A
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x422e(%rip), %rdi      # 0x7d4a
movl $0x16b, %ecx            # imm = 0x16B
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x18(%rsp), %r12
leaq 0x40ea(%rip), %rdi      # 0x7c21
movl $0x16c, %ecx            # imm = 0x16C
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
movl $0x16d, %ecx            # imm = 0x16D
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
pushq $0xb
popq %rax
movl %eax, 0x34(%r12)
leaq 0x40ba(%rip), %rax      # 0x7c26
movq %rax, 0x961d(%rip)      # 0xd190
leaq 0x95a6(%rip), %r15      # 0xd120
movq %r15, %rdi
movq %r14, %rsi
callq 0x237e
movslq %eax, %rsi
movl $0x172, %ecx            # imm = 0x172
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
pushq $0xb
popq %rdi
movl $0x173, %ecx            # imm = 0x173
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x40c0(%rip), %rdi      # 0x7c77
movl $0x174, %ecx            # imm = 0x174
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x40b8(%rip), %rdi      # 0x7c85
movl $0x175, %ecx            # imm = 0x175
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x176, %ecx            # imm = 0x176
leaq 0x4039(%rip), %rdi      # 0x7c21
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
pushq $0x2
popq %rdi
movl $0x177, %ecx            # imm = 0x177
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
pushq $0xb
popq %rax
movl %eax, 0x34(%r12)
leaq 0x4073(%rip), %rax      # 0x7c8b
movq %rax, 0x9571(%rip)      # 0xd190
movq %r15, %rdi
movq %r14, %rsi
callq 0x237e
movslq %eax, %rsi
movl $0x17c, %ecx            # imm = 0x17C
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
movl $0x17d, %ecx            # imm = 0x17D
pushq $0x3
popq %r14
movq %r14, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x3f0e(%rip), %rdi      # 0x7b6e
movl $0x17e, %ecx            # imm = 0x17E
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x17f, %ecx            # imm = 0x17F
leaq 0x40cf(%rip), %rdi      # 0x7d4a
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x3f38(%rip), %rdi      # 0x7bc4
movl $0x180, %ecx            # imm = 0x180
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
pushq $0x4
popq %rdi
movl $0x181, %ecx            # imm = 0x181
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movq %r15, %rdi
callq 0x1552
movzbl %al, %esi
movl $0x182, %ecx            # imm = 0x182
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
andq $0x0, (%r12)
pushq $0x3
popq %rax
movl %eax, 0x34(%r12)
leaq 0x4004(%rip), %rax      # 0x7ce6
movq %rax, 0x94a7(%rip)      # 0xd190
movq %r15, %rdi
movq %rsp, %rsi
movq %rsi, %rbp
callq 0x237e
movslq %eax, %rsi
movl $0x188, %ecx            # imm = 0x188
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
movl $0x189, %ecx            # imm = 0x189
movq %r14, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x4010(%rip), %rdi      # 0x7d39
movl $0x18a, %ecx            # imm = 0x18A
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x4008(%rip), %rdi      # 0x7d47
movl $0x18b, %ecx            # imm = 0x18B
leaq 0x10(%rsp), %rsi
movq %rsi, %r14
xorl %edx, %edx
callq 0x5a58
movl $0x18c, %ecx            # imm = 0x18C
leaq 0x3feb(%rip), %rdi      # 0x7d4a
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
pushq $0x1
popq %rdi
movl $0x18d, %ecx            # imm = 0x18D
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movq %r15, %rdi
callq 0x1552
movzbl %al, %esi
movl $0x18e, %ecx            # imm = 0x18E
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
pushq $0xb
popq %rax
movl %eax, 0x34(%r12)
leaq 0x3fa1(%rip), %rax      # 0x7d4c
movq %rax, 0x93de(%rip)      # 0xd190
movq %r15, %rdi
movq %rbp, %rsi
callq 0x237e
movslq %eax, %rsi
movl $0x193, %ecx            # imm = 0x193
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
movl $0x194, %ecx            # imm = 0x194
pushq $0xb
popq %r15
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x43ca(%rip), %rdi      # 0x81bd
movl $0x195, %ecx            # imm = 0x195
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x4407(%rip), %rbp      # 0x8210
movl $0x196, %ecx            # imm = 0x196
movq %rbp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x197, %ecx            # imm = 0x197
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
movl $0x198, %ecx            # imm = 0x198
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x40(%r12), %rsi
movl $0x199, %ecx            # imm = 0x199
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
leaq 0x92c0(%rip), %r14      # 0xd120
movq %r14, %rdi
callq 0x1552
movzbl %al, %esi
movl $0x19a, %ecx            # imm = 0x19A
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
pushq $0xb
popq %rax
movl %eax, 0x34(%r12)
leaq 0x3ed8(%rip), %rax      # 0x7d63
movq %rax, 0x92fe(%rip)      # 0xd190
movq %r14, %rdi
movq %rsp, %rsi
callq 0x237e
movslq %eax, %rsi
movl $0x1a0, %ecx            # imm = 0x1A0
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
movl $0x1a1, %ecx            # imm = 0x1A1
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movl $0x1a2, %ecx            # imm = 0x1A2
leaq 0x3e65(%rip), %rdi      # 0x7d39
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a58
leaq 0x3edf(%rip), %rdi      # 0x7dc4
movl $0x1a3, %ecx            # imm = 0x1A3
leaq 0x10(%rsp), %rbp
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x1a4, %ecx            # imm = 0x1A4
leaq 0x3cbf(%rip), %r13      # 0x7bc4
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
movl $0x1a5, %ecx            # imm = 0x1A5
pushq $0x4
popq %r15
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x40(%r12), %rsi
movl $0x1a6, %ecx            # imm = 0x1A6
pushq $0x3
popq %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movq %r14, %rdi
callq 0x1552
movzbl %al, %esi
movl $0x1a7, %ecx            # imm = 0x1A7
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
pushq $0xb
popq %rax
movl %eax, 0x34(%r12)
leaq 0x3e5b(%rip), %rax      # 0x7dca
movq %rax, 0x921a(%rip)      # 0xd190
movq %r14, %rdi
movq %rsp, %rsi
callq 0x237e
movslq %eax, %rsi
movl $0x1ad, %ecx            # imm = 0x1AD
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x34(%r12), %rsi
movl $0x1ae, %ecx            # imm = 0x1AE
pushq $0xb
popq %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movl $0x1af, %ecx            # imm = 0x1AF
leaq 0x3d81(%rip), %rdi      # 0x7d39
leaq 0x5c(%rsp), %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x1b0, %ecx            # imm = 0x1B0
leaq 0x3df4(%rip), %rdi      # 0x7dc4
movq %rbp, %rsi
xorl %edx, %edx
callq 0x5a58
movl $0x1b1, %ecx            # imm = 0x1B1
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x5a58
movslq 0x3c(%r12), %rsi
movl $0x1b2, %ecx            # imm = 0x1B2
movq %r15, %rdi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movslq 0x40(%r12), %rsi
pushq $0x5
popq %rdi
movl $0x1b3, %ecx            # imm = 0x1B3
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
movq %r14, %rdi
callq 0x1552
movzbl %al, %esi
movl $0x1b4, %ecx            # imm = 0x1B4
xorl %edi, %edi
xorl %edx, %edx
movl %ebx, %r8d
callq 0x507b
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq