Skip to content

Commit

Permalink
wip(tests): Add and fix more unit tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Nana <[email protected]>
  • Loading branch information
na2axl committed Oct 7, 2024
1 parent bcefb46 commit 6d10ac4
Show file tree
Hide file tree
Showing 15 changed files with 912 additions and 58 deletions.
Binary file added assets/data/tests/test_sound_01.wav
Binary file not shown.
Binary file added assets/data/tests/test_sound_02.wav
Binary file not shown.
Binary file added assets/data/tests/test_sound_03.wav
Binary file not shown.
53 changes: 53 additions & 0 deletions sample_project/collections/test_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"id": 1999,
"name": "test_collection",
"priority": {
"kind": "Static",
"value": 1.0
},
"gain": {
"kind": "Static",
"value": 1.0
},
"bus": 2,
"sounds_type": [
"Sequence",
"Sequence",
"Sequence"
],
"sounds": [
{
"sound": 9991,
"gain": {
"kind": "Static",
"value": 1.0
}
},
{
"sound": 9992,
"gain": {
"kind": "Static",
"value": 1.0
}
},
{
"sound": 9993,
"gain": {
"kind": "Static",
"value": 1.0
}
}
],
"spatialization": "None",
"attenuation": 0,
"play_mode": "PlayAll",
"scheduler": {
"mode": "Sequence",
"config_type": "Sequence",
"config": {
"end_behavior": "Reverse"
}
},
"scope": "World",
"fader": "Linear"
}
66 changes: 66 additions & 0 deletions sample_project/soundbanks/tests.init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"id": 1,
"name": "init",
"sounds": [
"background/AMBForst_Forest_ID_0100_BSB.wav.amsound",
"footsteps/snow/a.mp3.amsound",
"footsteps/snow/b.mp3.amsound",
"footsteps/metal/a.mp3.amsound",
"footsteps/metal/b.mp3.amsound",
"footsteps/grass/a.mp3.amsound",
"footsteps/grass/b.mp3.amsound",
"footsteps/grass/c.mp3.amsound",
"footsteps/grass/d.mp3.amsound",
"footsteps/grass/e.mp3.amsound",
"footsteps/grass/f.mp3.amsound",
"footsteps/grass/g.mp3.amsound",
"music/symphony.ogg.amsound",
"tests/test_sound_01.amsound",
"tests/test_sound_02.amsound",
"tests/test_sound_03.amsound",
"throw_01.ogg.amsound",
"throw_02.ogg.amsound",
"throw_03.ogg.amsound",
"throw_04.ogg.amsound",
"throw_05.ogg.amsound",
"throw_06.ogg.amsound",
"throw_07.ogg.amsound",
"throw_08.ogg.amsound"
],
"effects": [
"bassboost.amfx",
"delay.amfx",
"flanger.amfx",
"lpf.amfx",
"robotize.amfx"
],
"collections": [
"grass_footsteps.amcollection",
"metal_footsteps.amcollection",
"snow_footsteps.amcollection",
"test_collection.amcollection",
"throw_collection_1.amcollection",
"throw_collection_2.amcollection"
],
"events": [
"mute_bg_bus.amevent",
"play_throw.amevent",
"player_footstep.amevent",
"stop_throw.amevent"
],
"attenuators": [
"impact.amattenuation",
"room.amattenuation",
"pipe.amattenuation"
],
"switches": [
"env.amswitch",
"surface_type.amswitch"
],
"switch_containers": [
"footsteps.amswitchcontainer"
],
"rtpc": [
"rtpc_player_height.amrtpc"
]
}
22 changes: 22 additions & 0 deletions sample_project/sounds/tests/test_sound_01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": 9991,
"name": "test_sound_01",
"gain": {
"kind": "Static",
"value": 1.0
},
"bus": 1,
"priority": {
"kind": "Static",
"value": 1.0
},
"stream": false,
"loop": {
"enabled": false,
"loop_count": 5
},
"spatialization": "None",
"attenuation": 0,
"fader": "Linear",
"path": "tests/test_sound_01.wav"
}
22 changes: 22 additions & 0 deletions sample_project/sounds/tests/test_sound_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": 9992,
"name": "test_sound_02",
"gain": {
"kind": "Static",
"value": 1.0
},
"bus": 1,
"priority": {
"kind": "Static",
"value": 1.0
},
"stream": false,
"loop": {
"enabled": false,
"loop_count": 5
},
"spatialization": "None",
"attenuation": 0,
"fader": "Linear",
"path": "tests/test_sound_02.wav"
}
22 changes: 22 additions & 0 deletions sample_project/sounds/tests/test_sound_03.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"id": 9993,
"name": "test_sound_03",
"gain": {
"kind": "Static",
"value": 1.0
},
"bus": 1,
"priority": {
"kind": "Static",
"value": 1.0
},
"stream": false,
"loop": {
"enabled": false,
"loop_count": 5
},
"spatialization": "None",
"attenuation": 0,
"fader": "Linear",
"path": "tests/test_sound_03.wav"
}
11 changes: 10 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ add_executable(${PROJECT_NAME}
entity.cpp
engine.cpp
environment.cpp
common.cpp)
common.cpp
math.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE Catch2::Catch2 Shared)

add_custom_command(
Expand All @@ -41,9 +42,17 @@ add_dependencies(${PROJECT_NAME}
ss_amplitude_audio_sample_project
amac
ampk
amir
)

include(Catch)
catch_discover_tests(${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
)

target_compile_definitions(
${PROJECT_NAME}
PRIVATE
AM_SDK_PLATFORM="${VCPKG_TARGET_TRIPLET}"
AM_SDK_PATH="$ENV{AM_SDK_PATH}"
)
Loading

0 comments on commit 6d10ac4

Please sign in to comment.