Skip to content

Commit

Permalink
OscSpecification: test and examples separated
Browse files Browse the repository at this point in the history
  • Loading branch information
morisil committed Sep 24, 2023
1 parent 025f6b2 commit b02da5f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 52 deletions.
49 changes: 49 additions & 0 deletions xemantic-osc-api/src/commonTest/kotlin/OscSpecificationExamples.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* xemantic-osc - Kotlin idiomatic and multiplatform OSC protocol support
* Copyright (C) 2023 Kazimierz Pogoda
*
* This file is part of xemantic-osc.
*
* xemantic-osc is free software: you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* xemantic-osc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with xemantic-osc.
* If not, see <https://www.gnu.org/licenses/>.
*/

package com.xemantic.osc

/**
* See [Osc Message Examples](https://opensoundcontrol.stanford.edu/spec-1_0-examples.html).
*/
val oscillator4FrequencyBytes = ubyteArrayOf(
0x2fu, 0x6fu, 0x73u, 0x63u,
0x69u, 0x6cu, 0x6cu, 0x61u,
0x74u, 0x6fu, 0x72u, 0x2fu,
0x34u, 0x2fu, 0x66u, 0x72u,
0x65u, 0x71u, 0x75u, 0x65u,
0x6eu, 0x63u, 0x79u, 0x00u,
0x2cu, 0x66u, 0x00u, 0x00u,
0x43u, 0xdcu, 0x00u, 0x00u
).asByteArray()

/**
* See [Osc Message Examples](https://opensoundcontrol.stanford.edu/spec-1_0-examples.html).
*/
val fooBytes = ubyteArrayOf(
0x2fu, 0x66u, 0x6fu, 0x6fu,
0x00u, 0x00u, 0x00u, 0x00u,
0x2cu, 0x69u, 0x69u, 0x73u,
0x66u, 0x66u, 0x00u, 0x00u,
0x00u, 0x00u, 0x03u, 0xe8u,
0xffu, 0xffu, 0xffu, 0xffu,
0x68u, 0x65u, 0x6cu, 0x6cu,
0x6fu, 0x00u, 0x00u, 0x00u,
0x3fu, 0x9du, 0xf3u, 0xb6u,
0x40u, 0xb5u, 0xb2u, 0x2du
).asByteArray()
25 changes: 0 additions & 25 deletions xemantic-osc-api/src/commonTest/kotlin/OscSpecificationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,6 @@ import kotlin.test.Test
*/
class OscSpecificationTest {

// given
private val oscillator4FrequencyBytes = ubyteArrayOf(
0x2fu, 0x6fu, 0x73u, 0x63u,
0x69u, 0x6cu, 0x6cu, 0x61u,
0x74u, 0x6fu, 0x72u, 0x2fu,
0x34u, 0x2fu, 0x66u, 0x72u,
0x65u, 0x71u, 0x75u, 0x65u,
0x6eu, 0x63u, 0x79u, 0x00u,
0x2cu, 0x66u, 0x00u, 0x00u,
0x43u, 0xdcu, 0x00u, 0x00u
).asByteArray()

private val fooBytes = ubyteArrayOf(
0x2fu, 0x66u, 0x6fu, 0x6fu,
0x00u, 0x00u, 0x00u, 0x00u,
0x2cu, 0x69u, 0x69u, 0x73u,
0x66u, 0x66u, 0x00u, 0x00u,
0x00u, 0x00u, 0x03u, 0xe8u,
0xffu, 0xffu, 0xffu, 0xffu,
0x68u, 0x65u, 0x6cu, 0x6cu,
0x6fu, 0x00u, 0x00u, 0x00u,
0x3fu, 0x9du, 0xf3u, 0xb6u,
0x40u, 0xb5u, 0xb2u, 0x2du
).asByteArray()

data class Foo(
val firstInt: Int = 1000,
val secondInt: Int = -1,
Expand Down
27 changes: 0 additions & 27 deletions xemantic-osc-udp/src/jvmMain/kotlin/JvmUdpOscTransport.kt

This file was deleted.

0 comments on commit b02da5f

Please sign in to comment.