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_pipe2.cpp
15 // This is supporting program for testing pipes.
16 // This is used by main test file ( t_pipe.cpp) for testing
17 // pipes in multiprocess environment.
21 #define __E32TEST_EXTENSION__
27 LOCAL_D RTest test(_L("t_pipe2"));
28 _LIT(KPipeName5, "InterProcessPipe1");
31 _LIT8(KTestDataIP, "ABCDEFGHIJ");
32 _LIT8(KTestData,"Pipe Data To Be Passed");
34 LOCAL_C void RunTests(void)
36 test.Start(_L("Testing In Pipe Process 2"));
38 TInt ret; // Return value variable
42 const TBufC<50> cPipeName1(KPipeName5);
44 TBuf8<150> cPipeReadData1;
48 test.Next(_L("PIPE TEST: PipeProcess 2-1: Open Read Handle to unamed Pipe\n"));
49 ret=aReaderUN.Open(3,EOwnerProcess);
52 test.Next(_L("PIPE TEST: PipeProcess 2-1.1: Get the UnNamed pipe read handle from another process \n"));
53 ret = aReaderUN.Size();
56 ret = aReaderUN.MaxSize();
59 ret = aReaderUN.Read(cPipeReadData1,22);
62 ret = cPipeReadData1.Compare(KTestData);
63 test (ret == KErrNone);
68 test.Next(_L("Open handle to named pipe\n"));
71 ret = aReader.Open(cPipeName1, RPipe::EOpenToRead);
74 test.Next(_L("PIPE TEST: PipeProcess 2-2: Wait till NotifyDataAvailable.\n"));
76 aReader.NotifyDataAvailable(stat1);
78 User::WaitForRequest(stat1);
80 test.Next(_L("PIPE TEST: PipeProcess 2-3: Call ReadBlocking and Read the data.\n"));
83 ret = aReader.ReadBlocking(cPipeReadData1,aSize);
84 test_Equal(aSize, ret);
85 ret = cPipeReadData1.Compare(KTestDataIP);
86 test( ret== KErrNone);
88 test.Next(_L("PIPE TEST: PipeProcess 2-4: Exit Process t_pipe2.\n"));
94 GLDEF_C TInt E32Main()