diff -r c1f20ce4abcf -r 3e88ff8f41d5 kerneltest/e32test/system/t_atomicu.cpp --- a/kerneltest/e32test/system/t_atomicu.cpp Tue Aug 31 16:34:26 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of the License "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// e32test\system\t_atomicu.cpp -// Overview: -// Simple test for class User atomic operations -// API Information: -// User::SafeInc(), User::SafeDec(), User::LockedInc(), -// User::LockedDec() -// Details: -// - Tests SafeInc, SafeDec, LockedInc and LockedDec -// functions in single thread and determines that counts -// match after finished -// - Tests SafeInc, SafeDec, LockedInc and LockedDec -// functions in multithreaded configuration and determines -// that counts match after finished -// Platforms/Drives/Compatibility: -// All. -// Assumptions/Requirement/Pre-requisites: -// Failures and causes: -// Base Port information: -// -// - -#define __E32TEST_EXTENSION__ -#include -#include -#include - -LOCAL_D RTest test(_L("T_ATOMICU")); - -const TInt KMaxOps=20000; -#define KNumThreads 20 -TInt gValue=0; - -void TestSafeIncAndSafeDec() - { - gValue=0; - // increasing when 0, should return 0 - test(User::SafeInc(gValue)==0); - // value also should be 0 - test(gValue==0); - - gValue=1; - TInt expected=0; - // gValue should vary only between 1 and 2 - for (TInt i=0; i