diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-05-14 18:33:39 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-05-14 18:33:39 +0800 |
commit | 940aba6e5bdebaf958a0215c86ef1b1010f91a2f (patch) | |
tree | f76238feb12f4980fd4b6cf5a5c1104453ac0604 /ffi/cs/bls256_test.cs | |
parent | 5858d08066c633e1ca2df7fb4929427b9bf594e4 (diff) | |
download | dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar.gz dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar.bz2 dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar.lz dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar.xz dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.tar.zst dexon-bls-940aba6e5bdebaf958a0215c86ef1b1010f91a2f.zip |
add C# binding
Diffstat (limited to 'ffi/cs/bls256_test.cs')
-rw-r--r-- | ffi/cs/bls256_test.cs | 36 |
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); + } + } + } +} |