Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #include <e32msgqueue.h>
22 LOCAL_D RTest test(_L("t_mqueueecho"));
28 LOCAL_C void RunTests(void)
30 test.Start(_L("Testing"));
35 TInt ret = in.OpenGlobal(KQueueA);
36 test (KErrNone == ret);
37 ret = out.OpenGlobal(KQueueB);
38 test (KErrNone == ret);
40 TInt size = in.MessageSize();
41 test (size == out.MessageSize());
43 TUint8* pBuffer = (TUint8*)User::Alloc(size);
44 test (NULL != pBuffer);
49 in.ReceiveBlocking(pBuffer, size);
50 out.SendBlocking(pBuffer, size);
51 test.Printf(_L("Echo iteration %i received %i\r\n"), ++count, *(TInt*)pBuffer);
53 while (*(TInt*)pBuffer != 0);
58 test.Next(_L("Ending test.\n"));
64 GLDEF_C TInt E32Main()