aboutsummaryrefslogtreecommitdiffstats
path: root/ffi/cs/bls256_test.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ffi/cs/bls256_test.cs')
-rw-r--r--ffi/cs/bls256_test.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/ffi/cs/bls256_test.cs b/ffi/cs/bls256_test.cs
new file mode 100644
index 0000000..f649ddc
--- /dev/null
+++ b/ffi/cs/bls256_test.cs
@@ -0,0 +1,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);
+ }
+ }
+ }
+}