datacommsserver/esockserver/test/TE_ESock/EsockTestSection22.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2001-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 "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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This contains ESock Test cases from section 22
       
    15 // 
       
    16 //
       
    17 
       
    18 // EPOC includes
       
    19 #include <e32base.h>
       
    20 #include <in_sock.h>
       
    21 
       
    22 // Test system includes
       
    23 #include "EsockTestSection22.h"
       
    24 
       
    25 
       
    26 // Test step 22.1
       
    27 const TDesC& CEsockTest22_1::GetTestName()
       
    28 	{
       
    29 	// store the name of this test case
       
    30 	_LIT(ret,"Test22.1");
       
    31 	return ret;
       
    32 	}
       
    33 
       
    34 CEsockTest22_1::~CEsockTest22_1()
       
    35 	{
       
    36 	appendixInArray.Close();
       
    37 	appendixOutArray.Close();
       
    38 	}
       
    39 
       
    40 enum TVerdict CEsockTest22_1::easyTestStepL()
       
    41 	{
       
    42 	TInetAddr mask, addrOut;
       
    43 	
       
    44 	mask.Input(_L("ffff:ffff::"));
       
    45 	
       
    46 	if (!GetAppendixC1())
       
    47 		{
       
    48 		return EFail;
       
    49 		}
       
    50 	
       
    51 	if (!GetAppendixC3())
       
    52 		{
       
    53 		return EFail;
       
    54 		}
       
    55 	
       
    56 	// for each IP address
       
    57 	for (TInt i=0; i < appendixInArray.Count(); i++)
       
    58 		{
       
    59 		appendixInArray[i].SubNet(addrOut, mask);
       
    60 		if (addrOut.Match(appendixOutArray[i]))
       
    61 			{
       
    62 			return EFail;
       
    63 			}
       
    64 		}
       
    65 	
       
    66 	appendixInArray.Reset();
       
    67 	appendixOutArray.Reset();
       
    68 	return EPass;
       
    69 	}
       
    70