aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlaise <[email protected]>2019-07-29 09:54:58 -0500
committerMatthew Collins <[email protected]>2019-07-30 10:36:45 +0100
commit5ea817b1ffdb796eb6292b780b58e1a14bf4d873 (patch)
tree00ff40b1fd8c6a658ff77fede21464fefb697bf4 /src
parentUpdated to support SDK version 1.45 on Mac OS (diff)
downloadsteamworks-rs-5ea817b1ffdb796eb6292b780b58e1a14bf4d873.tar.xz
steamworks-rs-5ea817b1ffdb796eb6292b780b58e1a14bf4d873.zip
Fix for thread contention causing errors on Mac OS and segfaults on Windows
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs3
-rw-r--r--src/matchmaking.rs4
-rw-r--r--src/remote_storage.rs5
-rw-r--r--src/server.rs6
-rw-r--r--src/user.rs6
-rw-r--r--src/user_stats.rs3
6 files changed, 21 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 442e865..d9baa2f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -413,7 +413,10 @@ impl GameId {
#[cfg(test)]
mod tests {
use super::*;
+ use serial_test_derive::serial;
+
#[test]
+ #[serial]
fn basic_test() {
let (client, single) = Client::init().unwrap();
diff --git a/src/matchmaking.rs b/src/matchmaking.rs
index 061c9ef..5f02834 100644
--- a/src/matchmaking.rs
+++ b/src/matchmaking.rs
@@ -1,5 +1,6 @@
-
use super::*;
+#[cfg(test)]
+use serial_test_derive::serial;
/// Access to the steam matchmaking interface
pub struct Matchmaking<Manager> {
@@ -164,6 +165,7 @@ impl <Manager> Matchmaking<Manager> {
}
#[test]
+#[serial]
fn test_lobby() {
let (client, single) = Client::init().unwrap();
let mm = client.matchmaking();
diff --git a/src/remote_storage.rs b/src/remote_storage.rs
index 17357e7..386f70d 100644
--- a/src/remote_storage.rs
+++ b/src/remote_storage.rs
@@ -1,4 +1,6 @@
use super::*;
+#[cfg(test)]
+use serial_test_derive::serial;
/// Access to the steam remote storage interface
pub struct RemoteStorage<Manager> {
@@ -257,6 +259,7 @@ pub struct SteamFileInfo {
}
#[test]
+#[serial]
fn test_cloud() {
use std::io::{Write, Read};
let (client, _single) = Client::init().unwrap();
@@ -285,4 +288,4 @@ fn test_cloud() {
assert_eq!(output, "Testing");
-} \ No newline at end of file
+}
diff --git a/src/server.rs b/src/server.rs
index a7afbb1..122fd53 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -1,6 +1,7 @@
use super::*;
-
use std::net::Ipv4Addr;
+#[cfg(test)]
+use serial_test_derive::serial;
/// The main entry point into the steam client for servers.
///
@@ -234,6 +235,7 @@ impl Server {
}
#[test]
+#[serial]
fn test() {
let (server, single) = Server::init(
[127, 0, 0, 1].into(),
@@ -293,4 +295,4 @@ impl Drop for ServerManager {
sys::SteamGameServer_Shutdown();
}
}
-} \ No newline at end of file
+}
diff --git a/src/user.rs b/src/user.rs
index a57ae51..8dea06a 100644
--- a/src/user.rs
+++ b/src/user.rs
@@ -1,5 +1,6 @@
-
use super::*;
+#[cfg(test)]
+use serial_test_derive::serial;
/// Access to the steam user interface
pub struct User<Manager> {
@@ -106,6 +107,7 @@ pub enum AuthSessionError {
}
#[test]
+#[serial]
fn test() {
let (client, single) = Client::init().unwrap();
let user = client.user();
@@ -238,4 +240,4 @@ pub enum AuthSessionValidateError {
/// The user is banned from the game (not VAC)
#[fail(display = "the user is banned")]
PublisherIssuedBan,
-} \ No newline at end of file
+}
diff --git a/src/user_stats.rs b/src/user_stats.rs
index 2ab976b..f51981d 100644
--- a/src/user_stats.rs
+++ b/src/user_stats.rs
@@ -3,6 +3,8 @@ mod stat_callback;
pub use self::stat_callback::*;
use super::*;
+#[cfg(test)]
+use serial_test_derive::serial;
/// Access to the steam user interface
pub struct UserStats<Manager> {
@@ -216,6 +218,7 @@ pub enum LeaderboardDisplayType {
pub struct Leaderboard(u64);
#[test]
+#[serial]
fn test() {
let (client, single) = Client::init().unwrap();