예제 #1
0
 internal static void ck(Lucene.Net.Support.Buffer b, long got, long expected)
 {
     if (expected != got)
     {
         fail(b, expected, got);
     }
 }
예제 #2
0
 internal static void ck(Lucene.Net.Support.Buffer b, bool cond)
 {
     if (!cond)
     {
         fail("Condition failed", b);
     }
 }
예제 #3
0
 internal static void fail(Lucene.Net.Support.Buffer b,
                           string expected, char expectedChar,
                           string got, char gotChar)
 {
     if (b is ByteBuffer)
     {
         ByteBuffer bb = (ByteBuffer)b;
         int        n  = Math.Min(16, bb.Limit);
         for (int i = 0; i < n; i++)
         {
             output.Write(" " + (bb.Get(i) & 0xff).ToString("x4", CultureInfo.InvariantCulture));
         }
         output.WriteLine();
     }
     //if (b is CharBuffer) {
     //    CharBuffer bb = (CharBuffer)b;
     //    int n = Math.Min(16, bb.Limit);
     //    for (int i = 0; i < n; i++)
     //        output.Write(" " + (bb.get(i) & 0xffff).ToString("x4", CultureInfo.InvariantCulture));
     //    output.WriteLine();
     //}
     Assert.Fail(ToString(b)
                 + ": Expected '" + expectedChar + "'=0x"
                 + expected
                 + ", got '" + gotChar + "'=0x"
                 + got);
 }
예제 #4
0
 internal static void Show(int level, Lucene.Net.Support.Buffer b)
 {
     for (int i = 0; i < level; i++)
     {
         output.Write("  ");
     }
     output.WriteLine(ToString(b) + " " + b.GetHashCode().ToString("x4", CultureInfo.InvariantCulture));
 }
예제 #5
0
 internal static string ToString(Lucene.Net.Support.Buffer b)
 {
     return(b.GetType().Name
            + "[pos=" + b.Position
            + " lim=" + b.Limit
            + " cap=" + b.Capacity
            + "]");
 }
예제 #6
0
 internal static void ck(Lucene.Net.Support.Buffer b, double got, double expected)
 {
     if (expected != got)
     {
         fail(b,
              expected.ToString("0.0##########", CultureInfo.InvariantCulture), (char)expected,
              got.ToString("0.0##########", CultureInfo.InvariantCulture), (char)got);
     }
 }
예제 #7
0
 internal static void fail(Lucene.Net.Support.Buffer b, long expected, long got)
 {
     fail(b,
          (expected).ToString("x4", CultureInfo.InvariantCulture), (char)expected,
          (got).ToString("x4", CultureInfo.InvariantCulture), (char)got);
 }
예제 #8
0
 internal static void fail(String s, Lucene.Net.Support.Buffer b, Lucene.Net.Support.Buffer b2)
 {
     fail(s + ": "
          + ToString(b) + ", " + ToString(b2));
 }
예제 #9
0
        //static void fail(string s)
        //{
        //    Assert.Fail(s);
        //}

        internal static void fail(string s, Lucene.Net.Support.Buffer b)
        {
            fail(s + ": " + ToString(b));
        }