Inheritance: System.Collections.IComparer
Example #1
0
    public virtual bool runTest()
    {
        int    iCountErrors    = 0;
        int    iCountTestcases = 0;
        String strLoc          = "123_er";
        String strInfo         = null;

        Console.Out.Write(s_strClassMethod);
        Console.Out.Write(": ");
        Console.Out.Write(s_strTFPath + s_strTFName);
        Console.Out.Write(": ");
        Console.Out.Write(s_strDtTmVer);
        Console.Out.WriteLine(" runTest started...");
        Object o1;
        Char   chValue;
        Int16  i16Value;
        int    iReturnValue;

        Object[] oArrValues;
        Object[,] o2ArrValues;
        ICmpImplementor icmp1 = new ICmpImplementor();

        try
        {
LABEL_860_GENERAL:
            do
            {
                oArrValues = new Object[vArr.Length];
                for (int i = 0; i < vArr.Length; i++)
                {
                    oArrValues[i] = vArr[i];
                }
                Array.Sort(oArrValues, 3, 4, icmp1);
                ++iCountTestcases;
                for (int i = 0; i < oArrValues.Length; i++)
                {
                    o1 = iSortedvArr[i];
                    if (o1.Equals(oArrValues[i]) != true)
                    {
                        ++iCountErrors;
                        Console.WriteLine(s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
                    }
                }
                oArrValues = new Object[cArr.Length];
                for (int i = 0; i < cArr.Length; i++)
                {
                    oArrValues[i] = cArr[i];
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(null, 0, 1, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_835xr!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_972qr!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                oArrValues = new Object[cArr.Length];
                for (int i = 0; i < cArr.Length; i++)
                {
                    oArrValues[i] = cArr[i];
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(oArrValues, -1, 3, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_659fg!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_856df!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(oArrValues, 1, -3, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_6585fgj!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_gsjjj!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(oArrValues, oArrValues.Length, 1, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_469dfg!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_4986dg!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(oArrValues, 2, 2 + oArrValues.Length, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_735dfg!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_648sd!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
            } while (false);
        }
        catch (Exception exc_general)
        {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + "Error Err_8888yyy!  strLoc==" + strLoc + " ,exc_general==" + exc_general);
        }
        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Example #2
0
 public virtual bool runTest()
   {
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc="123_er";
   String strInfo = null;
   Console.Out.Write( s_strClassMethod );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strTFPath + s_strTFName );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strDtTmVer );
   Console.Out.WriteLine( " runTest started..." );
   Object o1;
   Char chValue;
   Int16 i16Value;
   int iReturnValue;
   Object[] oArrValues;
   Object[,] o2ArrValues;
   ICmpImplementor icmp1 = new ICmpImplementor();
   try
     {
     LABEL_860_GENERAL:
     do
       {
       oArrValues = new Object[vArr.Length];
       for(int i=0; i < vArr.Length; i++)
	 {
	 oArrValues[i]=vArr[i];
	 }
       Array.Sort(oArrValues, 3, 4, icmp1);
       ++iCountTestcases;
       for(int i=0; i < oArrValues.Length; i++)
	 {
	 o1 = iSortedvArr[i];
	 if ( o1.Equals(oArrValues[i]) != true )
	   {
	   ++iCountErrors;
	   Console.WriteLine( s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
	   }
	 }
       oArrValues = new Object[cArr.Length];
       for(int i=0; i < cArr.Length; i++)
	 {
	 oArrValues[i]=cArr[i];
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(null, 0, 1, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_835xr!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_972qr!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       oArrValues = new Object[cArr.Length];
       for(int i=0; i < cArr.Length; i++)
	 {
	 oArrValues[i]=cArr[i];
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(oArrValues, -1, 3, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_659fg!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_856df!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(oArrValues, 1, -3, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_6585fgj!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_gsjjj!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(oArrValues, oArrValues.Length, 1, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_469dfg!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_4986dg!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(oArrValues, 2, 2+ oArrValues.Length, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_735dfg!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_648sd!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       } while ( false );
     }
   catch (Exception exc_general)
     {
     ++iCountErrors;
     Console.WriteLine( s_strTFAbbrev + "Error Err_8888yyy!  strLoc=="+ strLoc +" ,exc_general=="+ exc_general );
     }
   if ( iCountErrors == 0 ) {   return true; }
   else {  return false;}
   }
 public bool runTest()
   {
   int iCountErrors = 0;
   int iCountTestcases = 0;
   String strLoc="123_er";
   String strInfo = null;
   Console.Out.Write( s_strClassMethod );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strTFPath + s_strTFName );
   Console.Out.Write( ": " );
   Console.Out.Write( s_strDtTmVer );
   Console.Out.WriteLine( " runTest started..." );
   Object o1;
   Char chValue;
   Int16 i16Value;
   int iReturnValue;
   Object[] oArrValues;
   Object[,] o2ArrValues;
   ICmpImplementor icmp1 = new ICmpImplementor();
   try
     {
     LABEL_860_GENERAL:
     do
       {
       oArrValues = new Object[vArr.Length];
       for(int i=0; i < vArr.Length; i++)
	 {
	 oArrValues[i]=vArr[i];
	 }
       Array.Sort(oArrValues, icmp1);
       ++iCountTestcases;
       ++iCountTestcases;
       for(int i=0; i < oArrValues.Length; i++)
	 {
	 o1 = iSortedvArr[i];
	 if ( o1.Equals(oArrValues[i]) != true )
	   {
	   ++iCountErrors;
	   Console.WriteLine( s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
	   }
	 }
       oArrValues = new Object[cArr.Length];
       for(int i=0; i < cArr.Length; i++)
	 {
	 oArrValues[i]=cArr[i];
	 }
       Array.Sort(oArrValues, (System.Collections.IComparer)null);
       ++iCountTestcases;
       for(int i=0; i < oArrValues.Length; i++)
	 {
	 o1 = cSortedArr[i];
	 if ( o1.Equals(oArrValues[i]) != true )
	   {
	   ++iCountErrors;
	   Console.WriteLine( s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
	   }
	 }
       oArrValues = new Object[gArr.Length];
       for(int i=0; i < gArr.Length; i++)
	 {
	 oArrValues[i]=gArr[i];
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(oArr, (System.Collections.IComparer)null);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_984fd!" );
	 }
       catch(InvalidOperationException ex)
	 {
	 }
       catch(Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine( "Error E_795gd!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       oArrValues = new Object[cArr.Length];
       for(int i=0; i < cArr.Length; i++)
	 {
	 oArrValues[i]=cArr[i];
	 }
       try
	 {
	 ++iCountTestcases;
	 Array.Sort(null, icmp1);
	 ++iCountErrors;
	 Console.WriteLine( s_strTFAbbrev + "Err_835xr!");
	 }
       catch (ArgumentException ex)
	 {
	 }
       catch (Exception ex)
	 {
	 ++iCountErrors;
	 Console.Error.WriteLine(" Error E_972qr!  , Wrong Exception thrown == " + ex.ToString());
	 Console.WriteLine(ex.StackTrace);
	 }
       oArrValues = new Object[cArr.Length];
       for(int i=0; i < cArr.Length; i++)
	 {
	 oArrValues[i]=cArr[i];
	 }
       } while ( false );
     }
   catch (Exception exc_general)
     {
     ++iCountErrors;
     Console.WriteLine( s_strTFAbbrev + "Error Err_8888yyy!  strLoc=="+ strLoc +" ,exc_general=="+ exc_general );
     }
   if ( iCountErrors == 0 ) {   return true; }
   else {  return false;}
   }
Example #4
0
    public bool runTest()
    {
        int    iCountErrors    = 0;
        int    iCountTestcases = 0;
        String strLoc          = "123_er";
        String strInfo         = null;

        Console.Out.Write(s_strClassMethod);
        Console.Out.Write(": ");
        Console.Out.Write(s_strTFPath + s_strTFName);
        Console.Out.Write(": ");
        Console.Out.Write(s_strDtTmVer);
        Console.Out.WriteLine(" runTest started...");
        Object o1;
        Char   chValue;
        Int16  i16Value;
        int    iReturnValue;

        Object[] oArrValues;
        Object[,] o2ArrValues;
        ICmpImplementor icmp1 = new ICmpImplementor();

        try
        {
LABEL_860_GENERAL:
            do
            {
                oArrValues = new Object[vArr.Length];
                for (int i = 0; i < vArr.Length; i++)
                {
                    oArrValues[i] = vArr[i];
                }
                Array.Sort(oArrValues, icmp1);
                ++iCountTestcases;
                ++iCountTestcases;
                for (int i = 0; i < oArrValues.Length; i++)
                {
                    o1 = iSortedvArr[i];
                    if (o1.Equals(oArrValues[i]) != true)
                    {
                        ++iCountErrors;
                        Console.WriteLine(s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
                    }
                }
                oArrValues = new Object[cArr.Length];
                for (int i = 0; i < cArr.Length; i++)
                {
                    oArrValues[i] = cArr[i];
                }
                Array.Sort(oArrValues, (System.Collections.IComparer)null);
                ++iCountTestcases;
                for (int i = 0; i < oArrValues.Length; i++)
                {
                    o1 = cSortedArr[i];
                    if (o1.Equals(oArrValues[i]) != true)
                    {
                        ++iCountErrors;
                        Console.WriteLine(s_strTFAbbrev + "Err_246sdf_" + i + ", oArrValues[i]==" + oArrValues[i] + " o1==" + o1);
                    }
                }
                oArrValues = new Object[gArr.Length];
                for (int i = 0; i < gArr.Length; i++)
                {
                    oArrValues[i] = gArr[i];
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(oArr, (System.Collections.IComparer)null);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_984fd!");
                }
                catch (InvalidOperationException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine("Error E_795gd!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                oArrValues = new Object[cArr.Length];
                for (int i = 0; i < cArr.Length; i++)
                {
                    oArrValues[i] = cArr[i];
                }
                try
                {
                    ++iCountTestcases;
                    Array.Sort(null, icmp1);
                    ++iCountErrors;
                    Console.WriteLine(s_strTFAbbrev + "Err_835xr!");
                }
                catch (ArgumentException ex)
                {
                }
                catch (Exception ex)
                {
                    ++iCountErrors;
                    Console.Error.WriteLine(" Error E_972qr!  , Wrong Exception thrown == " + ex.ToString());
                    Console.WriteLine(ex.StackTrace);
                }
                oArrValues = new Object[cArr.Length];
                for (int i = 0; i < cArr.Length; i++)
                {
                    oArrValues[i] = cArr[i];
                }
            } while (false);
        }
        catch (Exception exc_general)
        {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + "Error Err_8888yyy!  strLoc==" + strLoc + " ,exc_general==" + exc_general);
        }
        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }