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_pipe3.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.
 
    26 LOCAL_D RTest test(_L("t_pipe3"));
 
    28 _LIT(KPipeName2, "PipeWithNoCap");
 
    29 _LIT(KPipeName3, "PipeWithNoCapVID");
 
    30 _LIT(KPipeName4, "PipeWithRWCap");
 
    35 LOCAL_C void RunTests(void)
 
    38 	test.Start(_L("Testing In Pipe Process 3 : Process with No Capabilities"));
 
    39 	RPipe					aReader, aWriter;
 
    44 	test.Next(_L("PIPE TEST: PipeProcess 3-1: Open Read handle to Pipe with No capability.\n"));
 
    45 	ret = aReader.Open(KPipeName2,RPipe::EOpenToRead);
 
    46 	test ( ret == KErrNone);
 
    48 	test.Next(_L("PIPE TEST: PipeProcess 3-2: Open Write handle to Pipe with No capability.\n"));				 
 
    49 	ret = aWriter.Open(KPipeName2,RPipe::EOpenToWrite);
 
    50 	test ( ret == KErrNone);
 
    55 	test.Next(_L("PIPE TEST: PipeProcess 3-3: Open Write handle to Pipe with No capability.\n"));				 
 
    56 	ret = aReader.Open(KPipeName2,RPipe::EOpenToRead);
 
    57 	test ( ret == KErrNone);
 
    58 	ret = aWriter.Open(KPipeName2,RPipe::EOpenToWriteNamedPipeButFailOnNoReaders);
 
    59 	test ( ret == KErrNone);
 
    64 	test.Next(_L("PIPE TEST: PipeProcess 3-4: Destroy Pipe with No capability.\n"));				 
 
    65 	ret = RPipe::Destroy (KPipeName2);
 
    66 	test ( ret == KErrNone);
 
    69 	test.Next(_L("PIPE TEST: PipeProcess 3-5: Open Read handle to Pipe with Read-Write capability.\n"));
 
    70 	ret = aReader.Open(KPipeName4,RPipe::EOpenToRead);
 
    71 	test ( ret == KErrPermissionDenied);
 
    73 	test.Next(_L("PIPE TEST: PipeProcess 3-6: Open Write handle to Pipe with Read-Write capability.\n"));				 
 
    74 	ret = aWriter.Open(KPipeName4,RPipe::EOpenToWrite);
 
    75 	test ( ret == KErrPermissionDenied);
 
    81 	test.Next(_L("PIPE TEST: PipeProcess 3-7: Open Read handle to Pipe with No capability.\n"));
 
    82 	ret = aReader.Open(KPipeName3,RPipe::EOpenToRead);
 
    83 	test ( ret == KErrNone);
 
    85 	test.Next(_L("PIPE TEST: PipeProcess 3-8: Open Write handle to Pipe with No capability.\n"));				 
 
    86 	ret = aWriter.Open(KPipeName3,RPipe::EOpenToWrite);
 
    87 	test ( ret == KErrNone);
 
    92 	test.Next(_L("PIPE TEST: PipeProcess 3-9: Destroy Pipe with No capability.\n"));				 
 
    93 	ret = RPipe::Destroy (KPipeName3);
 
    94 	test ( ret == KErrNone);
 
    98 	ret = RPipe::Create(	aSize,
 
   101 							EOwnerProcess,//TOwnerType aTypeW
 
   102 							EOwnerProcess//TOwnerType aTypeW
 
   105 	test.Next(_L("PIPE TEST: PipeProcess 3-10: Create UnNamed Pipe. It shall be allow.\n"));				 
 
   106 	test ( ret == KErrNone);
 
   118 GLDEF_C TInt E32Main()