private static bool Bug()
    {
        ObjectManager     objmgr1;
        StreamingContext  sc1;
        ObjectIDGenerator objid1;
        TestFixup         tstfxp1;
        Int64             iRootID;
        Int64             iChildID;
        String            strValue;

        MemberInfo[] members;
        Boolean      fFirstTime;

        sc1      = new StreamingContext(StreamingContextStates.All);
        tstfxp1  = new TestFixup();
        strValue = "Hello World";
        objid1   = new ObjectIDGenerator();
        iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
        iChildID = objid1.GetId(strValue, out fFirstTime);
        members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
        objmgr1  = new ObjectManager(null, sc1);
        objmgr1.RecordFixup(iRootID, members[0], iChildID);
        try {
            objmgr1.RegisterObject(strValue, iChildID);
            return(true);
        } catch (Exception ex) {
            Console.WriteLine("Bug:Exception thrown, " + ex);
            return(false);
        }
    }
 private static bool Bug() {
 ObjectManager objmgr1;
 StreamingContext sc1;
 ObjectIDGenerator objid1;
 TestFixup tstfxp1;
 Int64 iRootID;
 Int64 iChildID;
 String strValue;
 MemberInfo[] members;
 Boolean fFirstTime;
 sc1 = new StreamingContext(StreamingContextStates.All);
 tstfxp1 = new TestFixup();
 strValue = "Hello World";
 objid1 = new ObjectIDGenerator();
 iRootID = objid1.GetId(tstfxp1, out fFirstTime);
 iChildID = objid1.GetId(strValue, out fFirstTime);
 members = FormatterServices.GetSerializableMembers(tstfxp1.GetType()); 
 objmgr1 = new ObjectManager(null, sc1);
 objmgr1.RecordFixup(iRootID, members[0], iChildID);
 try {
 objmgr1.RegisterObject(strValue, iChildID);	
 return true;
 } catch(Exception ex){
 Console.WriteLine("Bug:Exception thrown, " + ex);
 return false;
 }
 }
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		ObjectManager objmgr1 = null;
		ISurrogateSelector isur = null;
		StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
		ObjectIDGenerator objid1 = null;
		TestFixup tstfxp1;
		Int64 iRootID;
		Int64 iChildID;
		String strValue;
		bool fFirstTime;
		MemberInfo[] members = null;
		TestReference tst1;
		ThisImplementsIObjectReference tst2;
		try {
			do
			{
				strLoc="Loc_174cds";
				tstfxp1 = new TestFixup();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tstfxp1, out fFirstTime);
				strValue = "Hello World";
				iChildID = objid1.GetId(strValue, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[0], iChildID);
				objmgr1.RegisterObject(tstfxp1, iRootID);
				objmgr1.RegisterObject(strValue, iChildID);
				iCountTestcases++;
				if(!tstfxp1.strFixupValue.Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
				}
				objmgr1.DoFixups();
				iCountTestcases++;
				if(!tstfxp1.strFixupValue.Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
				}
				strLoc="Loc_5720xs";
				tst1 = new TestReference();
				tst2 = new ThisImplementsIObjectReference();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst1, out fFirstTime);
				iChildID = objid1.GetId(tst2, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(TestReference));
				Console.WriteLine("<<" + members[0].Name + ">>");
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[0], iChildID);
				objmgr1.RegisterObject(tst1, iRootID);
				objmgr1.RegisterObject(tst2, iChildID);
				try{
					iCountTestcases++;
					objmgr1.DoFixups();
					iCountErrors++;
					Console.WriteLine("Err_753fvdf! exception not thrown!!");
				}catch(SerializationException){
				}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
示例#4
0
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int                iCountErrors    = 0;
        int                iCountTestcases = 0;
        String             strLoc          = "Loc_000oo";
        ObjectManager      objmgr1         = null;
        ISurrogateSelector isur            = null;
        StreamingContext   sc1             = new StreamingContext(StreamingContextStates.All);
        ObjectIDGenerator  objid1          = null;
        TestFixup          tstfxp1;
        Int64              iRootID;
        Int64              iChildID;
        String             strValue;
        bool               fFirstTime;

        MemberInfo[] members = null;
        Test1        tst1;
        A            a1;
        Int32        iOurMan;
        Boolean      fChildFound;
        Test2        tst2;
        Test3        tst3;
        B            b1;

        try {
            do
            {
                tstfxp1  = new TestFixup();
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
                strValue = "Hello World";
                iChildID = objid1.GetId(strValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
                objmgr1  = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[0], iChildID);
                objmgr1.RegisterObject(tstfxp1, iRootID);
                objmgr1.RegisterObject(strValue, iChildID);
                iCountTestcases++;
                if (!tstfxp1.strFixupValue.Equals(strValue))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
                }
                objmgr1.DoFixups();
                iCountTestcases++;
                if (!tstfxp1.strFixupValue.Equals(strValue))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
                }
                tst1        = new Test1();
                a1          = new A();
                objid1      = new ObjectIDGenerator();
                iRootID     = objid1.GetId(tst1, out fFirstTime);
                iChildID    = objid1.GetId(a1, out fFirstTime);
                members     = FormatterServices.GetSerializableMembers(typeof(Test1));
                iOurMan     = -1;
                fChildFound = false;
                for (int i = 0; i < members.Length; i++)
                {
                    if (members[i].Name.Equals("a"))
                    {
                        fChildFound = true;
                        iOurMan     = i;
                        break;
                    }
                }
                if (!fChildFound)
                {
                    throw new Exception("Loc_342ds! didn't find the member");
                }
                objmgr1 = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
                try{
                    iCountTestcases++;
                    objmgr1.RegisterObject(a1, iChildID);
                    objmgr1.RegisterObject(tst1, iRootID);
                    objmgr1.DoFixups();
                    Console.WriteLine("Loc_0283! exception not thrown");
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
                }
                tst1        = new Test1();
                objid1      = new ObjectIDGenerator();
                iRootID     = objid1.GetId(tst1, out fFirstTime);
                a1          = new A();
                iChildID    = objid1.GetId(a1, out fFirstTime);
                members     = FormatterServices.GetSerializableMembers(typeof(Test1));
                iOurMan     = -1;
                fChildFound = false;
                for (int i = 0; i < members.Length; i++)
                {
                    if (members[i].Name.Equals("a"))
                    {
                        fChildFound = true;
                        iOurMan     = i;
                        break;
                    }
                }
                if (!fChildFound)
                {
                    throw new Exception("Loc_342ds! didn't find the member");
                }
                objmgr1 = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
                try{
                    iCountTestcases++;
                    objmgr1.DoFixups();
                    iCountErrors++;
                    Console.WriteLine("Err_7453fd! exception not thrown");
                }catch (SerializationException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1204cd! Unexpected exception, " + ex.ToString());
                }
                tst1        = new Test1();
                objid1      = new ObjectIDGenerator();
                iRootID     = objid1.GetId(tst1, out fFirstTime);
                a1          = new A();
                iChildID    = objid1.GetId(a1, out fFirstTime);
                members     = FormatterServices.GetSerializableMembers(typeof(Test1));
                iOurMan     = -1;
                fChildFound = false;
                for (int i = 0; i < members.Length; i++)
                {
                    if (members[i].Name.Equals("a"))
                    {
                        fChildFound = true;
                        iOurMan     = i;
                        break;
                    }
                }
                if (!fChildFound)
                {
                    throw new Exception("Loc_342ds! didn't find the member");
                }
                objmgr1 = new ObjectManager(isur, sc1);
                try{
                    iCountTestcases++;
                    objmgr1.RegisterObject(a1, iChildID);
                    objmgr1.RegisterObject(tst1, iRootID);
                    objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
                    objmgr1.DoFixups();
                    Console.WriteLine("Loc_02843cd! exception not thrown");
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0438fd! Unexpected exception, " + ex.ToString());
                }
                tst1        = new Test1();
                objid1      = new ObjectIDGenerator();
                iRootID     = objid1.GetId(tst1, out fFirstTime);
                a1          = new A();
                iChildID    = objid1.GetId(a1, out fFirstTime);
                members     = FormatterServices.GetSerializableMembers(typeof(Test1));
                iOurMan     = -1;
                fChildFound = false;
                for (int i = 0; i < members.Length; i++)
                {
                    if (members[i].Name.Equals("a"))
                    {
                        fChildFound = true;
                        iOurMan     = i;
                        break;
                    }
                }
                if (!fChildFound)
                {
                    throw new Exception("Loc_342fsd! didn't find the member");
                }
                objmgr1 = new ObjectManager(isur, sc1);
                try{
                    iCountTestcases++;
                    objmgr1.RegisterObject(a1, iChildID);
                    objmgr1.RegisterObject(tst1, iRootID);
                    objmgr1.DoFixups();
                    Console.WriteLine("Loc_94523fsd! exception not thrown");
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0348dcs! Unexpected exception, " + ex.ToString());
                }
                tst2        = new Test2();
                tst3        = new Test3();
                b1          = new B();
                b1.StrValue = "Hello World";
                tst3.Set_B  = b1;
                objid1      = new ObjectIDGenerator();
                iRootID     = objid1.GetId(tst2, out fFirstTime);
                iChildID    = objid1.GetId(tst3, out fFirstTime);
                members     = FormatterServices.GetSerializableMembers(typeof(Test2));
                iOurMan     = -1;
                fChildFound = false;
                for (int i = 0; i < members.Length; i++)
                {
                    if (members[i].Name.Equals("tst3"))
                    {
                        fChildFound = true;
                        iOurMan     = i;
                        break;
                    }
                }
                if (!fChildFound)
                {
                    throw new Exception("Loc_024fd! didn't find the member");
                }
                objmgr1 = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
                objmgr1.RegisterObject(tst2, iRootID);
                objmgr1.RegisterObject(tst3, iChildID);
                iCountTestcases++;
                Console.WriteLine("Loc_4523vfd! we hve, " + tst2.StrValue);
                if (!tst2.StrValue.Equals("Hello World"))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_038qm! Expected value not returned, " + tst2.StrValue);
                }
                tstfxp1  = new TestFixup();
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
                strValue = "Hello World";
                members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
                objmgr1  = new ObjectManager(null, sc1);
                objmgr1.RecordFixup(iRootID, members[0], iRootID);
                try{
                    iCountTestcases++;
                    objmgr1.RegisterObject(tstfxp1, iRootID);
                    iCountErrors++;
                    Console.WriteLine("Err_753cd! exception not thrown");
                }catch (ArgumentException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
                }
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordFixup(-1, members[0], iChildID);
                    iCountErrors++;
                    Console.WriteLine("Err_034cd! exception not thrown");
                }
                catch (ArgumentOutOfRangeException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_034cd! Unexpected exception, " + ex.ToString());
                }
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordFixup(iRootID, members[0], -5);
                    iCountErrors++;
                    Console.WriteLine("Err_037csd! exception not thrown");
                }
                catch (ArgumentOutOfRangeException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_710ca! Unexpected exception, " + ex.ToString());
                }
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordFixup(iRootID, null, iChildID);
                    iCountErrors++;
                    Console.WriteLine("Err_048cs! exception not thrown");
                }
                catch (ArgumentNullException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_079cd! Unexpected exception, " + ex.ToString());
                }
            } while (false);
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general.StackTrace);
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int               iCountErrors    = 0;
        int               iCountTestcases = 0;
        String            strLoc          = "Loc_000oo";
        ObjectManager     objmgr1         = null;
        StreamingContext  sc1             = new StreamingContext(StreamingContextStates.All);
        ObjectIDGenerator objid1          = null;
        TestFixup         tstfxp1;
        Int64             iRootID;
        Int64             iChildID;
        String            strValue;
        bool              fFirstTime;

        MemberInfo[] members = null;
        try {
            do
            {
                strLoc   = "Loc_174cds";
                tstfxp1  = new TestFixup();
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
                strValue = "Hello Universe";
                iChildID = objid1.GetId(strValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
                objmgr1  = new ObjectManager(null, sc1);
                iCountTestcases++;
                if (objmgr1.GetObject(iRootID) != null)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_753cd! Expected value not returned, " + objmgr1.GetObject(iRootID));
                }
                objmgr1.RecordFixup(iRootID, members[0], iChildID);
                iCountTestcases++;
                if (objmgr1.GetObject(iRootID) != null)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_048fd! Expected value not returned, " + objmgr1.GetObject(iRootID));
                }
                objmgr1.RegisterObject(tstfxp1, iRootID);
                iCountTestcases++;
                if (objmgr1.GetObject(iRootID) == null)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0943fd! Null returned");
                }
                iCountTestcases++;
                if (!((TestFixup)(objmgr1.GetObject(iRootID))).strFixupValue.Equals("Hello World"))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_047fe! wrong value returned returned, " + ((TestFixup)(objmgr1.GetObject(iRootID))).strFixupValue);
                }
                objmgr1.RegisterObject(strValue, iChildID);
                iCountTestcases++;
                if (objmgr1.GetObject(iChildID) == null)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_90853vdf! Null returned");
                }
                iCountTestcases++;
                if (!objmgr1.GetObject(iChildID).Equals("Hello Universe"))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_1084cs! wrong value returned returned, " + objmgr1.GetObject(iChildID));
                }
                try{
                    iCountTestcases++;
                    objmgr1.GetObject(-5);
                    iCountErrors++;
                    Console.WriteLine("Err_04872d! Exception not thrown");
                }catch (ArgumentOutOfRangeException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1083xs! Wrong Exception thrown, " + ex);
                }
            } while (false);
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general.StackTrace);
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
示例#6
0
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		ObjectManager objmgr1 = null;
		StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
		ObjectIDGenerator objid1 = null;
		TestFixup tstfxp1;
		Int64 iRootID;
		Int64 iChildID;
		String strValue;
		bool fFirstTime;
		MemberInfo[] members = null;
		try {
			do
			{
				strLoc="Loc_174cds";
				tstfxp1 = new TestFixup();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tstfxp1, out fFirstTime);
				strValue = "Hello Universe";
				iChildID = objid1.GetId(strValue, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
				objmgr1 = new ObjectManager(null, sc1);
				iCountTestcases++;
				if(objmgr1.GetObject(iRootID)!=null)
				{
					iCountErrors++;
					Console.WriteLine("Err_753cd! Expected value not returned, " + objmgr1.GetObject(iRootID));
				}
				objmgr1.RecordFixup(iRootID, members[0], iChildID);
				iCountTestcases++;
				if(objmgr1.GetObject(iRootID)!=null)
				{
					iCountErrors++;
					Console.WriteLine("Err_048fd! Expected value not returned, " + objmgr1.GetObject(iRootID));
				}
				objmgr1.RegisterObject(tstfxp1, iRootID);
				iCountTestcases++;
				if(objmgr1.GetObject(iRootID)==null)
				{
					iCountErrors++;
					Console.WriteLine("Err_0943fd! Null returned");
				}
				iCountTestcases++;
				if(!((TestFixup)(objmgr1.GetObject(iRootID))).strFixupValue.Equals("Hello World"))
				{
					iCountErrors++;
					Console.WriteLine("Err_047fe! wrong value returned returned, " + ((TestFixup)(objmgr1.GetObject(iRootID))).strFixupValue);
				}
				objmgr1.RegisterObject(strValue, iChildID);
				iCountTestcases++;
				if(objmgr1.GetObject(iChildID)==null)
				{
					iCountErrors++;
					Console.WriteLine("Err_90853vdf! Null returned");
				}
				iCountTestcases++;
				if(!objmgr1.GetObject(iChildID).Equals("Hello Universe"))
				{
					iCountErrors++;
					Console.WriteLine("Err_1084cs! wrong value returned returned, " + objmgr1.GetObject(iChildID));
				}
				try{
					iCountTestcases++;
					objmgr1.GetObject(-5);
					iCountErrors++;
					Console.WriteLine("Err_04872d! Exception not thrown");
					}catch(ArgumentOutOfRangeException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1083xs! Wrong Exception thrown, " + ex);
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
示例#7
0
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int                iCountErrors    = 0;
        int                iCountTestcases = 0;
        String             strLoc          = "Loc_000oo";
        ObjectManager      objmgr1         = null;
        ISurrogateSelector isur            = null;
        StreamingContext   sc1             = new StreamingContext(StreamingContextStates.All);
        ObjectIDGenerator  objid1          = null;
        TestFixup          tstfxp1;
        TestFixup_1        tstfxp2;
        Int64              iRootID;
        Int64              iChildID;
        Int32              iValue;
        bool               fFirstTime;

        MemberInfo[]      members = null;
        SerializationInfo serInfo1;

        try {
            do
            {
                strLoc   = "Loc_8345vdfv";
                tstfxp1  = new TestFixup();
                iValue   = 10;
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
                iChildID = objid1.GetId(iValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
                objmgr1  = new ObjectManager(isur, sc1);
                objmgr1.RecordDelayedFixup(iRootID, "iFixupValue", iChildID);
                serInfo1 = new SerializationInfo(typeof(TestFixup), new FormatterConverter());
                objmgr1.RegisterObject(tstfxp1, iRootID, serInfo1);
                objmgr1.RegisterObject(iValue, iChildID);
                objmgr1.DoFixups();
                strLoc = "Loc_017ged";
                iCountTestcases++;
                if (tstfxp1.iFixupValue != iValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.iFixupValue.ToString() + ", expected, " + iValue.ToString());
                }
                strLoc   = "Loc_04853fe";
                tstfxp2  = new TestFixup_1();
                iValue   = 10;
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp2, out fFirstTime);
                iChildID = objid1.GetId(iValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp2.GetType());
                objmgr1  = new ObjectManager(isur, sc1);
                objmgr1.RecordDelayedFixup(iRootID, "DOES_NOT_HAVE_TO_BE_FIELD_NAME", iChildID);
                serInfo1 = new SerializationInfo(typeof(TestFixup_1), new FormatterConverter());
                objmgr1.RegisterObject(tstfxp2, iRootID, serInfo1);
                objmgr1.RegisterObject(iValue, iChildID);
                objmgr1.DoFixups();
                strLoc = "Loc_9572fd";
                iCountTestcases++;
                if (tstfxp2.iFixupValue != iValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_1534csd! Expected value not returned, " + tstfxp2.iFixupValue.ToString() + ", expected, " + iValue.ToString());
                }
                strLoc   = "Loc_742d023";
                tstfxp2  = new TestFixup_1();
                iValue   = 10;
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp2, out fFirstTime);
                iChildID = objid1.GetId(iValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp2.GetType());
                objmgr1  = new ObjectManager(isur, sc1);
                objmgr1.RecordDelayedFixup(iRootID, "DOES_NOT_EXIST", iChildID);
                serInfo1 = new SerializationInfo(typeof(TestFixup_1), new FormatterConverter());
                objmgr1.RegisterObject(tstfxp2, iRootID, serInfo1);
                try {
                    iCountTestcases++;
                    objmgr1.RegisterObject(iValue, iChildID);
                    objmgr1.DoFixups();
                    iCountErrors++;
                    Console.WriteLine("Err_74823fd! exception not thrown");
                }catch (TargetInvocationException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0542dfvs! Unexpected exception, " + ex.ToString());
                }
                strLoc = "Loc_0358vdf";
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordDelayedFixup(-1, "iFixupValue", iChildID);
                    iCountErrors++;
                    Console.WriteLine("Err_034cd! exception not thrown");
                }
                catch (ArgumentOutOfRangeException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_034cd! Unexpected exception, " + ex.ToString());
                }
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordDelayedFixup(iRootID, "iFixupValue", -5);
                    iCountErrors++;
                    Console.WriteLine("Err_037csd! exception not thrown");
                }
                catch (ArgumentOutOfRangeException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_710ca! Unexpected exception, " + ex.ToString());
                }
                try
                {
                    iCountTestcases++;
                    objmgr1.RecordDelayedFixup(iRootID, null, iChildID);
                    iCountErrors++;
                    Console.WriteLine("Err_048cs! exception not thrown");
                }
                catch (ArgumentNullException) {}
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_079cd! Unexpected exception, " + ex.ToString());
                }
            } while (false);
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general.ToString());
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
示例#8
0
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int                iCountErrors    = 0;
        int                iCountTestcases = 0;
        String             strLoc          = "Loc_000oo";
        ObjectManager      objmgr1         = null;
        ISurrogateSelector isur            = null;
        StreamingContext   sc1             = new StreamingContext(StreamingContextStates.All);
        ObjectIDGenerator  objid1          = null;
        TestFixup          tstfxp1;
        Int64              iRootID;
        Int64              iChildID;
        String             strValue;
        bool               fFirstTime;

        MemberInfo[]  members = null;
        TestReference tst1;
        ThisImplementsIObjectReference tst2;

        try {
            do
            {
                strLoc   = "Loc_174cds";
                tstfxp1  = new TestFixup();
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
                strValue = "Hello World";
                iChildID = objid1.GetId(strValue, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
                objmgr1  = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[0], iChildID);
                objmgr1.RegisterObject(tstfxp1, iRootID);
                objmgr1.RegisterObject(strValue, iChildID);
                iCountTestcases++;
                if (!tstfxp1.strFixupValue.Equals(strValue))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
                }
                objmgr1.DoFixups();
                iCountTestcases++;
                if (!tstfxp1.strFixupValue.Equals(strValue))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
                }
                strLoc   = "Loc_5720xs";
                tst1     = new TestReference();
                tst2     = new ThisImplementsIObjectReference();
                objid1   = new ObjectIDGenerator();
                iRootID  = objid1.GetId(tst1, out fFirstTime);
                iChildID = objid1.GetId(tst2, out fFirstTime);
                members  = FormatterServices.GetSerializableMembers(typeof(TestReference));
                Console.WriteLine("<<" + members[0].Name + ">>");
                objmgr1 = new ObjectManager(isur, sc1);
                objmgr1.RecordFixup(iRootID, members[0], iChildID);
                objmgr1.RegisterObject(tst1, iRootID);
                objmgr1.RegisterObject(tst2, iChildID);
                try{
                    iCountTestcases++;
                    objmgr1.DoFixups();
                    iCountErrors++;
                    Console.WriteLine("Err_753fvdf! exception not thrown!!");
                }catch (SerializationException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
                }
            } while (false);
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general.StackTrace);
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		ObjectManager objmgr1 = null;
		ISurrogateSelector isur = null;
		StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
		ObjectIDGenerator objid1 = null;
		TestFixup tstfxp1;
		Int64 iRootID;
		Int64 iChildID;
		Int32 iValue;
		bool fFirstTime;
		MemberInfo[] members = null;
		SerializationInfo serInfo1;
		try {
			do
			{
				strLoc = "Loc_8345vdfv";
				tstfxp1 = new TestFixup();
				iValue = 10;
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tstfxp1, out fFirstTime);
				iChildID = objid1.GetId(iValue, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordDelayedFixup(iRootID, "iFixupValue", iChildID);
				serInfo1 = new SerializationInfo(typeof(TestFixup), new FormatterConverter());
				objmgr1.RegisterObject(tstfxp1, iRootID, serInfo1);
				iCountTestcases++;
				if(objmgr1.GetObject(iRootID)==null)
				{
					iCountErrors++;
					Console.WriteLine("Err_0943fd! Null returned");
				}
				objmgr1.RegisterObject(iValue, iChildID);
				objmgr1.DoFixups();
				strLoc = "Loc_017ged";
				iCountTestcases++;
				if(tstfxp1.iFixupValue != iValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.iFixupValue.ToString() + ", expected, " + iValue.ToString());
				}
				strLoc = "Loc_0358vdf";
				try
				{
					iCountTestcases++;
					objmgr1.RegisterObject(null, iRootID, serInfo1);
					iCountErrors++;
					Console.WriteLine("Err_034cd! exception not thrown");
				}
				catch(ArgumentNullException){}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_03472fd! Unexpected exception, " + ex.ToString());
				}
				try
				{
					iCountTestcases++;
					objmgr1.RegisterObject(tstfxp1, -5, serInfo1);
					iCountErrors++;
					Console.WriteLine("Err_037csd! exception not thrown");
				}
				catch(ArgumentOutOfRangeException){}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_710ca! Unexpected exception, " + ex.ToString());
				}
				try
				{
					iCountTestcases++;
					objmgr1.RegisterObject(tstfxp1, 5, null);
					Console.WriteLine("Loc_048cs! exception not thrown");
				}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_079cd! Unexpected exception, " + ex.ToString());
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.ToString());
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
示例#10
0
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		ObjectManager objmgr1 = null;
		ISurrogateSelector isur = null;
		StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
		ObjectIDGenerator objid1 = null;
		TestFixup tstfxp1;
		Int64 iRootID;
		Int64 iChildID;
		String strValue;
		bool fFirstTime;
		MemberInfo[] members = null;
		Test1 tst1;
		A a1;
		Int32 iOurMan;
		Boolean fChildFound;
		Test2 tst2;
		Test3 tst3;
		B b1;
		try {
			do
			{
				tstfxp1 = new TestFixup();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tstfxp1, out fFirstTime);
				strValue = "Hello World";
				iChildID = objid1.GetId(strValue, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[0], iChildID);
				objmgr1.RegisterObject(tstfxp1, iRootID);
				objmgr1.RegisterObject(strValue, iChildID);
				iCountTestcases++;
				if(!tstfxp1.strFixupValue.Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
				}
				objmgr1.DoFixups();
				iCountTestcases++;
				if(!tstfxp1.strFixupValue.Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
				}
				tst1 = new Test1();
				a1 = new A();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst1, out fFirstTime);
				iChildID = objid1.GetId(a1, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(Test1));
				iOurMan = -1;
				fChildFound=false;
				for(int i=0; i<members.Length;i++){
					if(members[i].Name.Equals("a")){
						fChildFound=true;
						iOurMan=i;
						break;
					}
				}
				if(!fChildFound)
				throw new Exception("Loc_342ds! didn't find the member");
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
				try{
					iCountTestcases++;
					objmgr1.RegisterObject(a1, iChildID);
					objmgr1.RegisterObject(tst1, iRootID);
					objmgr1.DoFixups();
					Console.WriteLine("Loc_0283! exception not thrown");
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
				}
				tst1 = new Test1();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst1, out fFirstTime);
				a1 = new A();
				iChildID = objid1.GetId(a1, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(Test1));
				iOurMan = -1;
				fChildFound=false;
				for(int i=0; i<members.Length;i++){
					if(members[i].Name.Equals("a")){
						fChildFound=true;
						iOurMan=i;
						break;
					}
				}
				if(!fChildFound)
				throw new Exception("Loc_342ds! didn't find the member");
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
				try{
					iCountTestcases++;
					objmgr1.DoFixups();
					iCountErrors++;
					Console.WriteLine("Err_7453fd! exception not thrown");
					}catch(SerializationException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1204cd! Unexpected exception, " + ex.ToString());
				}
				tst1 = new Test1();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst1, out fFirstTime);
				a1 = new A();
				iChildID = objid1.GetId(a1, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(Test1));
				iOurMan = -1;
				fChildFound=false;
				for(int i=0; i<members.Length;i++){
					if(members[i].Name.Equals("a")){
						fChildFound=true;
						iOurMan=i;
						break;
					}
				}
				if(!fChildFound)
				throw new Exception("Loc_342ds! didn't find the member");
				objmgr1 = new ObjectManager(isur, sc1);
				try{
					iCountTestcases++;
					objmgr1.RegisterObject(a1, iChildID);
					objmgr1.RegisterObject(tst1, iRootID);
					objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
					objmgr1.DoFixups();
					Console.WriteLine("Loc_02843cd! exception not thrown");
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_0438fd! Unexpected exception, " + ex.ToString());
				}
				tst1 = new Test1();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst1, out fFirstTime);
				a1 = new A();
				iChildID = objid1.GetId(a1, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(Test1));
				iOurMan = -1;
				fChildFound=false;
				for(int i=0; i<members.Length;i++){
					if(members[i].Name.Equals("a")){
						fChildFound=true;
						iOurMan=i;
						break;
					}
				}
				if(!fChildFound)
				throw new Exception("Loc_342fsd! didn't find the member");
				objmgr1 = new ObjectManager(isur, sc1);
				try{
					iCountTestcases++;
					objmgr1.RegisterObject(a1, iChildID);
					objmgr1.RegisterObject(tst1, iRootID);
					objmgr1.DoFixups();
					Console.WriteLine("Loc_94523fsd! exception not thrown");
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_0348dcs! Unexpected exception, " + ex.ToString());
				}
				tst2 = new Test2();
				tst3 = new Test3();
				b1 = new B();
				b1.StrValue = "Hello World";
				tst3.Set_B=b1;
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tst2, out fFirstTime);
				iChildID = objid1.GetId(tst3, out fFirstTime);
				members = FormatterServices.GetSerializableMembers(typeof(Test2));
				iOurMan = -1;
				fChildFound=false;
				for(int i=0; i<members.Length;i++){
					if(members[i].Name.Equals("tst3")){
						fChildFound=true;
						iOurMan=i;
						break;
					}
				}
				if(!fChildFound)
				throw new Exception("Loc_024fd! didn't find the member");
				objmgr1 = new ObjectManager(isur, sc1);
				objmgr1.RecordFixup(iRootID, members[iOurMan], iChildID);
				objmgr1.RegisterObject(tst2, iRootID);
				objmgr1.RegisterObject(tst3, iChildID);
				iCountTestcases++;
				Console.WriteLine("Loc_4523vfd! we hve, " + tst2.StrValue);
				if(!tst2.StrValue.Equals("Hello World"))
				{
					iCountErrors++;
					Console.WriteLine("Err_038qm! Expected value not returned, " + tst2.StrValue);
				}
				tstfxp1 = new TestFixup();
				objid1 = new ObjectIDGenerator();
				iRootID = objid1.GetId(tstfxp1, out fFirstTime);
				strValue = "Hello World";
				members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
				objmgr1 = new ObjectManager(null, sc1);
				objmgr1.RecordFixup(iRootID, members[0], iRootID);
				try{
					iCountTestcases++;
					objmgr1.RegisterObject(tstfxp1, iRootID);
					iCountErrors++;
					Console.WriteLine("Err_753cd! exception not thrown");
					}catch(ArgumentException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_04523cd! Unexpected exception, " + ex.ToString());
				}
				try
				{
					iCountTestcases++;
					objmgr1.RecordFixup(-1, members[0], iChildID);
					iCountErrors++;
					Console.WriteLine("Err_034cd! exception not thrown");
				}
				catch(ArgumentOutOfRangeException){}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_034cd! Unexpected exception, " + ex.ToString());
				}
				try
				{
					iCountTestcases++;
					objmgr1.RecordFixup(iRootID, members[0], -5);
					iCountErrors++;
					Console.WriteLine("Err_037csd! exception not thrown");
				}
				catch(ArgumentOutOfRangeException){}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_710ca! Unexpected exception, " + ex.ToString());
				}
				try
				{
					iCountTestcases++;
					objmgr1.RecordFixup(iRootID, null, iChildID);
					iCountErrors++;
					Console.WriteLine("Err_048cs! exception not thrown");
				}
				catch(ArgumentNullException){}
				catch(Exception ex)
				{
					iCountErrors++;
					Console.WriteLine("Err_079cd! Unexpected exception, " + ex.ToString());
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
示例#11
0
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + "\\" + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
		String strLoc = "Loc_000oo";
		String strValue = String.Empty;
		int iCountErrors = 0;
		int iCountTestcases = 0;
		ObjectManager objmgr1 = null;
		ISurrogateSelector isur = null;
		StreamingContext sc1 = new StreamingContext(StreamingContextStates.All);
		ObjectIDGenerator objid1 = null;
		TestFixup tstfxp1;
		Int64 iRootID;
		Int64 iChildID;
		bool fFirstTime;
		MemberInfo[] members = null;
		try
		{
			strLoc = "Loc_9347sg";
			iCountTestcases++;
			try{
				ConstructOM(); 
				iCountErrors++;
				Console.WriteLine("Err_7349sg! No exception thrown, ");
			}catch(SecurityException){
			}catch(Exception ex){
				iCountErrors++;
				Console.WriteLine("Err_348tdg! Wrong exception thrown, " + ex.GetType().Name);
			}
			strLoc = "Loc_3946tsg";
			iCountTestcases++;
			tstfxp1 = new TestFixup();
			objid1 = new ObjectIDGenerator();
			iRootID = objid1.GetId(tstfxp1, out fFirstTime);
			strValue = "Hello World";
			iChildID = objid1.GetId(strValue, out fFirstTime);
			members = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
			objmgr1 = new ObjectManager(isur, sc1);
			objmgr1.RecordFixup(iRootID, members[0], iChildID);
			objmgr1.RegisterObject(tstfxp1, iRootID);
			objmgr1.RegisterObject(strValue, iChildID);
			iCountTestcases++;
			if(!tstfxp1.strFixupValue.Equals(strValue))
			{
				iCountErrors++;
				Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
			}
			objmgr1.DoFixups();
			iCountTestcases++;
			if(!tstfxp1.strFixupValue.Equals(strValue))
			{
				iCountErrors++;
				Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
			}
		} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general=="+exc_general.ToString());
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs. "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
			return true;
		}
		else
		{
			Console.WriteLine("FAiL! "+s_strTFName+" ,inCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
示例#12
0
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + "\\" + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
        String             strLoc          = "Loc_000oo";
        String             strValue        = String.Empty;
        int                iCountErrors    = 0;
        int                iCountTestcases = 0;
        ObjectManager      objmgr1         = null;
        ISurrogateSelector isur            = null;
        StreamingContext   sc1             = new StreamingContext(StreamingContextStates.All);
        ObjectIDGenerator  objid1          = null;
        TestFixup          tstfxp1;
        Int64              iRootID;
        Int64              iChildID;
        bool               fFirstTime;

        MemberInfo[] members = null;
        try
        {
            strLoc = "Loc_9347sg";
            iCountTestcases++;
            try{
                ConstructOM();
                iCountErrors++;
                Console.WriteLine("Err_7349sg! No exception thrown, ");
            }catch (SecurityException) {
            }catch (Exception ex) {
                iCountErrors++;
                Console.WriteLine("Err_348tdg! Wrong exception thrown, " + ex.GetType().Name);
            }
            strLoc = "Loc_3946tsg";
            iCountTestcases++;
            tstfxp1  = new TestFixup();
            objid1   = new ObjectIDGenerator();
            iRootID  = objid1.GetId(tstfxp1, out fFirstTime);
            strValue = "Hello World";
            iChildID = objid1.GetId(strValue, out fFirstTime);
            members  = FormatterServices.GetSerializableMembers(tstfxp1.GetType());
            objmgr1  = new ObjectManager(isur, sc1);
            objmgr1.RecordFixup(iRootID, members[0], iChildID);
            objmgr1.RegisterObject(tstfxp1, iRootID);
            objmgr1.RegisterObject(strValue, iChildID);
            iCountTestcases++;
            if (!tstfxp1.strFixupValue.Equals(strValue))
            {
                iCountErrors++;
                Console.WriteLine("Err_753cd! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
            }
            objmgr1.DoFixups();
            iCountTestcases++;
            if (!tstfxp1.strFixupValue.Equals(strValue))
            {
                iCountErrors++;
                Console.WriteLine("Err_90342ddvs! Expected value not returned, " + tstfxp1.strFixupValue + ", expected, " + strValue);
            }
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==" + exc_general.ToString());
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs. " + s_strTFName + " ,iCountTestcases==" + iCountTestcases.ToString());
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL! " + s_strTFName + " ,inCountErrors==" + iCountErrors.ToString() + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }