Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- uses: actions/checkout@v4
- run: rustup --version
- run: cargo test
- run: cargo test --no-default-features
- run: cargo build --release
- run: cargo fmt --check
- run: cargo clippy -- -Dclippy::all
Expand Down
14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ version = "0.11.3"
[features]
default = ["std"]
lints = ["clippy"]
std = []
std = ["time"]

[dependencies]
byteorder = {version = "1", default-features = false}
clippy = {version = "^0", optional = true}
nom = {version = "7", default-features = false, features = ["alloc"]}
time = { version = "0.3.9", default-features = false, features = ["formatting"] }
byteorder = { version = "1", default-features = false }
clippy = { version = "^0", optional = true }
nom = { version = "7", default-features = false, features = ["alloc"] }
time = { version = "0.3.9", default-features = false, features = [
"formatting",
], optional = true }

[dev-dependencies]
hex = {version = "0.4"}
hex = { version = "0.4" }
2 changes: 2 additions & 0 deletions tests/address_test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]

extern crate rosc;

#[cfg(feature = "std")]
Expand Down
13 changes: 13 additions & 0 deletions tests/decode_encode_test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]

extern crate rosc;

use rosc::{decoder, encoder};
Expand All @@ -10,6 +12,7 @@ const GOLDEN_MESSAGE_WITH_ALL_TYPES: &str = "2f616e6f746865722f616464726573732f3
const GOLDEN_EMPTY_BUNDLE: &str = "2362756e646c65000000000400000002";
const GOLDEN_BUNDLE: &str = "2362756e646c6500000004d2000010e10000000c2f766965772f31002c000000000000202f6d697865722f6368616e6e656c2f312f616d70000000002c6600003f666666000000442362756e646c65000000162e0000223d000000142f6f73632f312f66726571002c690000000001b8000000182f6f73632f312f7068617365000000002c660000becccccd";

#[cfg(feature = "std")]
#[test]
fn test_message_wo_args() {
let packet = OscPacket::Message(OscMessage {
Expand All @@ -24,6 +27,8 @@ fn test_message_wo_args() {
assert_eq!(0, tail.len());
assert_eq!(packet, decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_message_wo_args_tcp() {
let packet = OscPacket::Message(OscMessage {
Expand All @@ -42,6 +47,7 @@ fn test_message_wo_args_tcp() {
assert_eq!(Some(packet), decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_encode_message_with_all_types() {
let packet = OscPacket::Message(OscMessage {
Expand Down Expand Up @@ -95,6 +101,8 @@ fn test_encode_message_with_all_types() {
assert_eq!(0, tail.len());
assert_eq!(packet, decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_encode_message_with_all_types_tcp() {
let packet = OscPacket::Message(OscMessage {
Expand Down Expand Up @@ -152,6 +160,8 @@ fn test_encode_message_with_all_types_tcp() {
assert_eq!(0, tail.len());
assert_eq!(Some(packet), decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_empty_bundle() {
let packet = OscPacket::Bundle(OscBundle {
Expand All @@ -167,6 +177,7 @@ fn test_empty_bundle() {
assert_eq!(packet, decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_bundle() {
let packet = OscPacket::Bundle(OscBundle {
Expand Down Expand Up @@ -244,6 +255,7 @@ fn test_bundle_cursor() {
assert_eq!(hex::decode(GOLDEN_BUNDLE).unwrap(), bytes);
}

#[cfg(feature = "std")]
#[test]
fn test_decode_encoded_message_four_byte_aligned_blob() {
let message = OscPacket::Message(OscMessage {
Expand All @@ -255,6 +267,7 @@ fn test_decode_encoded_message_four_byte_aligned_blob() {
assert_eq!(message, decoded_packet)
}

#[cfg(feature = "std")]
#[test]
fn test_decode_encoded_message_four_byte_aligned_blob_and_string() {
let message = OscPacket::Message(OscMessage {
Expand Down
3 changes: 3 additions & 0 deletions tests/types_test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]

extern crate rosc;

use rosc::{OscArray, OscType};
Expand All @@ -11,6 +13,7 @@ use std::{
time::{Duration, SystemTime, UNIX_EPOCH},
};

#[cfg(feature = "std")]
#[test]
fn test_osc_array_from_iter() {
use std::iter::FromIterator;
Expand Down
Loading