Update contrib.
1 // Copyright (c) 2002-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\pipe\t_pipe5.cpp
15 // This process has ReadDeviceData capability
16 // This is supporting program for testing pipes.
17 // This is used by main test file ( t_pipe.cpp) for testing
18 // pipes in multiprocess environment.
27 LOCAL_D RTest test(_L("t_pipe5"));
29 _LIT(KPipeName2, "PipeWithNoCap");
30 _LIT(KPipeName4, "PipeWithRWCap");
31 _LIT(KPipeName5, "PipeWithComDDCap");
32 _LIT(KPipeName6, "PipeWithRWComDDCap");
33 _LIT(KPipeName7, "PipeWithRWComDDCapVID");
34 _LIT(KPipeName8, "PipeWithRWRUCap");
39 LOCAL_C void RunTests(void)
42 test.Start(_L("Testing In Pipe Process 5 : Process with ReadDeviceData Capabilities"));
43 RPipe aReader, aWriter;
48 test.Next(_L("PIPE TEST: PipeProcess 5-1\n"));
49 ret = aReader.Open(KPipeName2,RPipe::EOpenToRead);
50 test ( ret == KErrNone);
52 test.Next(_L("PIPE TEST: PipeProcess 5-2\n"));
53 ret = aWriter.Open(KPipeName2,RPipe::EOpenToWrite);
54 test ( ret == KErrNone);
59 test.Next(_L("PIPE TEST: PipeProcess 5-3\n"));
60 ret = aReader.Open(KPipeName2,RPipe::EOpenToRead);
61 test ( ret == KErrNone);
62 ret = aWriter.Open(KPipeName2,RPipe::EOpenToWriteNamedPipeButFailOnNoReaders);
63 test ( ret == KErrNone);
68 test.Next(_L("PIPE TEST: PipeProcess 5-4\n"));
69 ret = RPipe::Destroy (KPipeName2);
70 test ( ret == KErrNone);
74 test.Next(_L("PIPE TEST: PipeProcess 5-5\n"));
75 ret = aReader.Open(KPipeName4,RPipe::EOpenToRead);
76 test ( ret == KErrNone);
78 test.Next(_L("PIPE TEST: PipeProcess 5-6\n"));
79 ret = aWriter.Open(KPipeName4,RPipe::EOpenToWrite);
80 test ( ret == KErrNone);
85 test.Next(_L("PIPE TEST: PipeProcess 5-7\n"));
86 ret = RPipe::Destroy (KPipeName4);
87 test ( ret == KErrNone);
91 test.Next(_L("PIPE TEST: PipeProcess 5-8\n"));
92 ret = aReader.Open(KPipeName5,RPipe::EOpenToRead);
93 test ( ret == KErrNone);
95 test.Next(_L("PIPE TEST: PipeProcess 5-9\n"));
96 ret = aWriter.Open(KPipeName5,RPipe::EOpenToWrite);
97 test ( ret == KErrNone);
102 test.Next(_L("PIPE TEST: PipeProcess 5-10\n"));
103 ret = RPipe::Destroy (KPipeName5);
104 test ( ret == KErrNone);
108 test.Next(_L("PIPE TEST: PipeProcess 5-11\n"));
109 ret = aReader.Open(KPipeName6,RPipe::EOpenToRead);
110 test ( ret == KErrNone);
112 test.Next(_L("PIPE TEST: PipeProcess 5-12\n"));
113 ret = aWriter.Open(KPipeName6,RPipe::EOpenToWrite);
114 test ( ret == KErrNone);
119 test.Next(_L("PIPE TEST: PipeProcess 5-13\n"));
120 ret = RPipe::Destroy (KPipeName6);
121 test ( ret == KErrNone);
125 test.Next(_L("PIPE TEST: PipeProcess 5-14\n"));
126 ret = aReader.Open(KPipeName7,RPipe::EOpenToRead);
127 test ( ret == KErrPermissionDenied);
129 test.Next(_L("PIPE TEST: PipeProcess 5-15\n"));
130 ret = aWriter.Open(KPipeName7,RPipe::EOpenToWrite);
131 test ( ret == KErrPermissionDenied);
136 test.Next(_L("PIPE TEST: PipeProcess 5-16\n"));
137 ret = RPipe::Destroy (KPipeName7);
138 test ( ret == KErrPermissionDenied);
142 test.Next(_L("PIPE TEST: PipeProcess 5-17\n"));
143 ret = aReader.Open(KPipeName8,RPipe::EOpenToRead);
144 test ( ret == KErrPermissionDenied);
146 test.Next(_L("PIPE TEST: PipeProcess 5-18\n"));
147 ret = aWriter.Open(KPipeName8,RPipe::EOpenToWrite);
148 test ( ret == KErrPermissionDenied);
153 test.Next(_L("PIPE TEST: PipeProcess 5-19\n"));
154 ret = RPipe::Destroy (KPipeName8);
155 test ( ret == KErrPermissionDenied);
159 ret = RPipe::Create( aSize,
162 EOwnerProcess,//TOwnerType aTypeW
163 EOwnerProcess//TOwnerType aTypeW
166 test.Next(_L("PIPE TEST: PipeProcess 5-20\n"));
167 test ( ret == KErrNone);
177 GLDEF_C TInt E32Main()