aboutsummaryrefslogtreecommitdiffstats
path: root/ffi/cs/bls256_test.cs
blob: f649ddce0eccd4d83536595e7abd1b3ec3c3bc1e (plain) (blame)
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
using System;

namespace mcl {
    using static BLS256;
    class BLS256Test {
        static int err = 0;
        static void assert(string msg, bool b)
        {
            if (b) return;
            Console.WriteLine("ERR {0}", msg);
            err++;
        }
        static void TestId()
        {
            Console.WriteLine("TestId");
            Id id = new Id();
            id.SetStr("255", 10);
            Console.WriteLine("id={0}", id.GetStr(10));
            Console.WriteLine("id={0}", id.GetStr(16));
        }
        static void Main(string[] args)
        {
            try {
                Init();
                TestId();
                if (err == 0) {
                    Console.WriteLine("all tests succeed");
                } else {
                    Console.WriteLine("err={0}", err);
                }
            } catch (Exception e) {
                Console.WriteLine("ERR={0}", e);
            }
        }
    }
}