public void testDecoder3(){
  boolean res;
  int originalAppIdValue=mAppIdValue;
  int originalContentTypeValue=mContentTypeValue;
  Random rd=new Random();
  for (int i=0; i < 100; i++) {
    mAppIdValue=rd.nextInt(0x0FFFFFFF);
    mContentTypeValue=rd.nextInt(0x0FFF);
    byte[] pdu=createPDU(3);
    WspTypeDecoder pduDecoder=new WspTypeDecoder(pdu);
    res=pduDecoder.seekXWapApplicationId(mWspHeaderStart,mWspHeaderStart + mWspHeaderLen - 1);
    assertTrue(res);
    int index=(int)pduDecoder.getValue32();
    res=pduDecoder.decodeXWapApplicationId(index);
    assertTrue(res);
    Log.d(LOG_TAG,"mAppIdValue: " + mAppIdValue + ", val: "+ pduDecoder.getValue32());
    assertTrue(mAppIdValue == (int)pduDecoder.getValue32());
  }
  mAppIdValue=originalAppIdValue;
  mContentTypeValue=originalContentTypeValue;
}

public void testDecoder3 ( ) { boolean res ; int originalAppIdValue = mAppIdValue ; int originalContentTypeValue = mContentTypeValue ; Random rd = new Random ( ) ; for ( int i = 0 ; i < 100 ; i ++ ) { mAppIdValue = rd . nextInt ( 0x0FFFFFFF ) ; mContentTypeValue = rd . nextInt ( 0x0FFF ) ; byte [ ] pdu = createPDU ( 3 ) ; WspTypeDecoder pduDecoder = new WspTypeDecoder ( pdu ) ; res = pduDecoder . seekXWapApplicationId ( mWspHeaderStart , mWspHeaderStart + mWspHeaderLen - 1 ) ; assertTrue ( res ) ; int index = ( int ) pduDecoder . getValue32 ( ) ; res = pduDecoder . decodeXWapApplicationId ( index ) ; assertTrue ( res ) ; Log . d ( LOG_TAG , "mAppIdValue: " + mAppIdValue + ", val: " + pduDecoder . getValue32 ( ) ) ; assertTrue ( mAppIdValue == ( int ) pduDecoder . getValue32 ( ) ) ; } mAppIdValue = originalAppIdValue ; mContentTypeValue = originalContentTypeValue ; }
wsptypedecoder test , decode appid test
