aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/TestSuite/Util.cs
blob: edc2a54bb8c75c57487cd59257bfcd558e18a8e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;

namespace OpenSim.TestSuite
{

    public class Utils
    {
        enum Result {
            Fail = 0,
            Pass = 1,
            Skip = 3
        }
        
        private static String ResultToString(Result r)
        {
            if (r == Result.Pass)
            {
                return "PASS";
            } 
            else if (r == Result.Fail)
            {
                return "FAIL";
            }
            else if (r == Result.Skip)
            {
                return "SKIP";
            }
            else 
            {
                return "UNKNOWN";
            }
        }
        
        
        private static void TestResult(Result r, String msg)
        {
            System.Console.WriteLine("[{0}]: {1}", ResultToString(r), msg);
        }
        
        public static void TestFail(String msg)
        {
            TestResult(Result.Fail, msg);
        }
        
        public static void TestPass(String msg)
        {
            TestResult(Result.Pass, msg);
        }
        
        public static void TestSkip(String msg)
        {
            TestResult(Result.Skip, msg);       
        }
    }
}