This is a simple test for poi in sccp_create_sccp_addr.
I also try to test gti, but I always get Segmentation fault. I use gdb and
find it stops in line 512. I can print the value of sock->gti_len, i don't
know what's wrong.


 512         gti = msgb_put(msg, sock->gti_len);
 513         memcpy(gti, sock->gti, sock->gti_len);


Wenbin WU
Uppsala University, Sweden


On Wed, Nov 17, 2010 at 8:33 AM, Wenbin Wu <wenbi...@gmail.com> wrote:

> Hi Holger,
>
> I will try to do this next week, since I have something to do this week.
> Thanks for noticing.
>
> On 2010-11-16, at 下午9:02, Holger Hans Peter Freyther wrote:
>
> > On 10/21/2010 10:23 AM, Wenbin Wu wrote:
> >> Hello,
> >
> > Hi,
> >
> > it would be nice if you could test the latest version of libosmo-sccp. I
> have
> > made the sccp_create_addr public[1], I have changed the creation of the
> > address to set the size correctly[2] and I have used the return value of
> the
> > sccp_create_addr[3] to update the variable_called and such.
> >
> > The added test case in [2] is still only checking address creation with
> only a
> > SSN. It would be nice if any of you in sweden could add a test case for
> POI.
> >
> > I hope you will be able to try this.
> >       z.
> >
> >
> >
> >
> >
> >
> > [1]
> >
> http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=ec5409ca4f46c30813c7d213d15880a691e8e91f
> > [2]
> >
> http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=13cd1199b92b98241d594c02873cd80a218a80ac
> > [3]
> >
> http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=6ecf8104c0e2fd6e01402c001160349e1810193a
>
>
diff --git a/tests/sccp/sccp_test.c b/tests/sccp/sccp_test.c
index 35b4cb7..c85d03b 100644
--- a/tests/sccp/sccp_test.c
+++ b/tests/sccp/sccp_test.c
@@ -903,14 +903,31 @@ static uint8_t ssn_out[] = {
 	0x02, 0x42, 0xfe,
 };
 
+const struct sockaddr_sccp sccp_poi_bssap = {
+	.sccp_family	= 0,
+	.sccp_ssn	= SCCP_SSN_BSSAP,
+	.poi            = {0x01, 0x00},
+	.use_poi        = 1,
+};
+
+static uint8_t poi_out[] = {
+	0x04, 0x43, 0x01, 0x00, 0xfe,
+};
+
 static struct sccp_addr_tst sccp_addr_tst[] = {
 	{
 		.addr		= &sccp_ssn_bssap,
 		.output		= ssn_out,
 		.output_len	= ARRAY_SIZE(ssn_out),
 	},
+	{
+		.addr		= &sccp_poi_bssap,
+		.output		= poi_out,
+		.output_len	= ARRAY_SIZE(poi_out),
+	},
 };
 
+
 static void test_sccp_address()
 {
 	int i, ret;

Reply via email to