mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
added more test timeouts
This commit is contained in:
parent
5991839c27
commit
650d221baf
@ -122,12 +122,17 @@ public void Deserialize()
|
||||
|
||||
client.Inventory.Refresh();
|
||||
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
|
||||
//
|
||||
// Block until we have the items
|
||||
//
|
||||
while ( client.Inventory.SerializedItems == null )
|
||||
{
|
||||
client.Update();
|
||||
|
||||
if (stopwatch.Elapsed.Seconds > 10)
|
||||
throw new System.Exception("Getting SerializedItems took too long");
|
||||
}
|
||||
|
||||
Assert.IsNotNull( client.Inventory.SerializedItems );
|
||||
@ -140,7 +145,15 @@ public void Deserialize()
|
||||
|
||||
var result = server.Inventory.Deserialize( client.Inventory.SerializedItems );
|
||||
|
||||
server.UpdateWhile( () => result.IsPending );
|
||||
stopwatch = Stopwatch.StartNew();
|
||||
|
||||
while (result.IsPending)
|
||||
{
|
||||
server.Update();
|
||||
|
||||
if (stopwatch.Elapsed.Seconds > 10)
|
||||
throw new System.Exception("result took too long");
|
||||
}
|
||||
|
||||
Assert.IsFalse( result.IsPending );
|
||||
Assert.IsNotNull( result.Items );
|
||||
|
@ -73,10 +73,16 @@ public void GetLeaderboardCallback()
|
||||
{
|
||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||
|
||||
var time = Stopwatch.StartNew();
|
||||
while ( !board.IsValid )
|
||||
{
|
||||
Thread.Sleep( 10 );
|
||||
client.Update();
|
||||
|
||||
if (time.Elapsed.TotalSeconds > 10)
|
||||
{
|
||||
throw new Exception("board.IsValid took too long");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue( board.IsValid );
|
||||
@ -115,10 +121,16 @@ public void AddScores()
|
||||
{
|
||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||
|
||||
var time = Stopwatch.StartNew();
|
||||
while (!board.IsValid)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
client.Update();
|
||||
|
||||
if (time.Elapsed.TotalSeconds > 10)
|
||||
{
|
||||
throw new Exception("board.IsValid took too long");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue( board.IsValid );
|
||||
@ -153,10 +165,16 @@ public void AddScoresCallback()
|
||||
{
|
||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||
|
||||
var time = Stopwatch.StartNew();
|
||||
while (!board.IsValid)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
client.Update();
|
||||
|
||||
if (time.Elapsed.TotalSeconds > 10)
|
||||
{
|
||||
throw new Exception("board.IsValid took too long");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue( board.IsValid );
|
||||
@ -189,10 +207,16 @@ public void AddFileAttachment()
|
||||
{
|
||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||
|
||||
var time = Stopwatch.StartNew();
|
||||
while (!board.IsValid)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
client.Update();
|
||||
|
||||
if (time.Elapsed.TotalSeconds > 10)
|
||||
{
|
||||
throw new Exception("board.IsValid took too long");
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue( board.IsValid );
|
||||
|
Loading…
Reference in New Issue
Block a user