encode size error is fixed
This commit is contained in:
parent
9c182f9697
commit
31e4aa6237
|
@ -65,7 +65,8 @@ int s1ap_encode_pdu(pkbuf_t **pkb, s1ap_message *message_p)
|
|||
return -1;
|
||||
}
|
||||
|
||||
(*pkb)->len = encoded;
|
||||
(*pkb)->len = (encoded >> 3);
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ static void enb_setup_test1(abts_case *tc, void *data)
|
|||
|
||||
pkbuf_free(sendbuf);
|
||||
|
||||
rc = enb_net_read(sock, recvbuf, 216);
|
||||
ABTS_INT_EQUAL(tc, 216, rc);
|
||||
rc = enb_net_read(sock, recvbuf, 27);
|
||||
ABTS_INT_EQUAL(tc, 27, rc);
|
||||
|
||||
rv = s1ap_decode_pdu(&message, recvbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
|
|
@ -81,31 +81,43 @@ static void s1ap_test3(abts_case *tc, void *data)
|
|||
|
||||
static void s1ap_test4(abts_case *tc, void *data)
|
||||
{
|
||||
s1ap_message message;
|
||||
status_t rv;
|
||||
pkbuf_t *pkbuf;
|
||||
int result;
|
||||
|
||||
rv = s1ap_build_setup_rsp(&pkbuf);
|
||||
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf->payload);
|
||||
ABTS_INT_EQUAL(tc, 216, pkbuf->len);
|
||||
ABTS_INT_EQUAL(tc, 27, pkbuf->len);
|
||||
|
||||
result = s1ap_decode_pdu(&message, pkbuf);
|
||||
ABTS_INT_EQUAL(tc, 0, result);
|
||||
|
||||
s1ap_free_pdu(&message);
|
||||
pkbuf_free(pkbuf);
|
||||
}
|
||||
|
||||
static void s1ap_test5(abts_case *tc, void *data)
|
||||
{
|
||||
s1ap_message message;
|
||||
status_t rv;
|
||||
pkbuf_t *pkbuf;
|
||||
int result;
|
||||
|
||||
rv = s1ap_build_setup_req(&pkbuf);
|
||||
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf);
|
||||
ABTS_PTR_NOTNULL(tc, pkbuf->payload);
|
||||
ABTS_INT_EQUAL(tc, 280, pkbuf->len);
|
||||
ABTS_INT_EQUAL(tc, 35, pkbuf->len);
|
||||
|
||||
result = s1ap_decode_pdu(&message, pkbuf);
|
||||
ABTS_INT_EQUAL(tc, 0, result);
|
||||
|
||||
s1ap_free_pdu(&message);
|
||||
pkbuf_free(pkbuf);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
|
||||
#include "core.h"
|
||||
#include "core_debug.h"
|
||||
|
||||
#include "cellwire.h"
|
||||
#include "context.h"
|
||||
#include "abts.h"
|
||||
|
@ -50,6 +52,8 @@ void test_initialize(void)
|
|||
|
||||
threads_start();
|
||||
|
||||
d_msg_to(D_MSG_TO_STDOUT, 0);
|
||||
|
||||
inet_pton(AF_INET, "127.0.0.1", &mme_self()->enb_local_addr);
|
||||
|
||||
atexit(test_terminate);
|
||||
|
|
Loading…
Reference in New Issue