|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This contains ESock Test cases from section 24 |
|
15 // |
|
16 // |
|
17 |
|
18 // EPOC includes |
|
19 #include <e32base.h> |
|
20 #include <in_sock.h> |
|
21 |
|
22 // Test system includes |
|
23 #include "EsockTestSection24.h" |
|
24 |
|
25 |
|
26 // Test step 24.1 |
|
27 const TDesC& CEsockTest24_1::GetTestName() |
|
28 { |
|
29 // store the name of this test case |
|
30 _LIT(ret,"Test24.1"); |
|
31 return ret; |
|
32 } |
|
33 |
|
34 CEsockTest24_1::~CEsockTest24_1() |
|
35 { |
|
36 } |
|
37 |
|
38 enum TVerdict CEsockTest24_1::easyTestStepL() |
|
39 { |
|
40 TInetAddr addr; |
|
41 |
|
42 // flow label |
|
43 |
|
44 // set the IP address |
|
45 const TIp6Addr KInet6addr1 = {{{ 0xff,0xfe,0x10,0x2c,0xff,0xaa,0,0,0,0,0,0,0,0,0,1 }}}; |
|
46 addr.SetAddress(KInet6addr1); |
|
47 |
|
48 |
|
49 TInt def_flow = addr.FlowLabel(); |
|
50 TESTL(def_flow==0); |
|
51 |
|
52 // set the flow label |
|
53 addr.SetFlowLabel(27); |
|
54 |
|
55 // get the flow label |
|
56 TInt flow = addr.FlowLabel(); |
|
57 TESTL(flow==27); |
|
58 |
|
59 // set the flow label again |
|
60 addr.SetFlowLabel(0xffff); |
|
61 |
|
62 // get the flow label again |
|
63 flow = addr.FlowLabel(); |
|
64 TESTL(flow==0xffff); |
|
65 |
|
66 addr.SetFlowLabel(0); |
|
67 |
|
68 return EPass; |
|
69 } |
|
70 |
|
71 |
|
72 // Test step 24.2 |
|
73 const TDesC& CEsockTest24_2::GetTestName() |
|
74 { |
|
75 // store the name of this test case |
|
76 _LIT(ret,"Test24.2"); |
|
77 return ret; |
|
78 } |
|
79 |
|
80 CEsockTest24_2::~CEsockTest24_2() |
|
81 { |
|
82 } |
|
83 |
|
84 enum TVerdict CEsockTest24_2::easyTestStepL() |
|
85 { |
|
86 TInetAddr addr; |
|
87 |
|
88 // scope |
|
89 |
|
90 // set the IP address |
|
91 const TIp6Addr KInet6addr1 = {{{ 0xff,0xfe,0x10,0x2c,0xff,0xaa,0,0,0,0,0,0,0,0,0,1 }}}; |
|
92 addr.SetAddress(KInet6addr1); |
|
93 |
|
94 TInt default_scope = addr.Scope(); |
|
95 TESTL(default_scope==0); |
|
96 |
|
97 |
|
98 // set the scope |
|
99 addr.SetScope(1); |
|
100 |
|
101 // get the scope |
|
102 TInt scope = addr.Scope(); |
|
103 TESTL(scope==1); |
|
104 |
|
105 // change the scope |
|
106 addr.SetScope(15); |
|
107 |
|
108 // get the scope |
|
109 scope = addr.Scope(); |
|
110 TESTL(scope==15); |
|
111 |
|
112 addr.SetScope(0); |
|
113 |
|
114 |
|
115 return EPass; |
|
116 } |
|
117 |