Tanoda
LeapCStressTests.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9#if !UNITY_EDITOR_LINUX
10
11using System;
12using NUnit.Framework;
13using LeapInternal;
14
15namespace Leap.LeapCSharp.Tests {
16 [TestFixture()]
17 public class LeapCStressTests {
18 [Test()]
19 public void TestCreateDestroy() {
20 IntPtr connHandle = IntPtr.Zero;
21 int iterations = 5000;
22 for (int i = 0; i < iterations; i++) {
23 //LEAP_CONNECTION_MESSAGE msg = new LEAP_CONNECTION_MESSAGE();
24 LeapC.CreateConnection(out connHandle);
25 LeapC.OpenConnection(connHandle);
26 LeapC.DestroyConnection(connHandle);
27 }
28 }
29
30 [Test()]
32 IntPtr connHandle = IntPtr.Zero;
33 int iterations = 5000;
34 uint requestId;
35 for (int i = 0; i < iterations; i++) {
36 //LEAP_CONNECTION_MESSAGE msg = new LEAP_CONNECTION_MESSAGE();
37 LeapC.CreateConnection(out connHandle);
38 LeapC.OpenConnection(connHandle);
39 LeapC.RequestConfigValue(connHandle, "tracking_version", out requestId);
40 LeapC.DestroyConnection(connHandle);
41 }
42 }
43 }
44}
45
46#endif
static eLeapRS OpenConnection(IntPtr hConnection)
static eLeapRS CreateConnection(ref LEAP_CONNECTION_CONFIG pConfig, out IntPtr pConnection)
static eLeapRS RequestConfigValue(IntPtr hConnection, string name, out UInt32 request_id)
static void DestroyConnection(IntPtr connection)