(t *testing.T)
| 195 | } |
| 196 | |
| 197 | func TestAudioLoaderUnload(t *testing.T) { |
| 198 | engo.Files.SetRoot("testdata") |
| 199 | if err := engo.Files.Load("sfx_coin_double2.wav"); err != nil { |
| 200 | t.Errorf("Could not load file. Error was: %v\n", err) |
| 201 | } |
| 202 | if _, err := LoadedPlayer("sfx_coin_double2.wav"); err != nil { |
| 203 | t.Errorf("Coud not get player from loaded file. Error was: %v\n", err) |
| 204 | } |
| 205 | if err := engo.Files.Unload("sfx_coin_double2.wav"); err != nil { |
| 206 | t.Errorf("Could not unload file. Error was: %v\n", err) |
| 207 | } |
| 208 | if _, err := LoadedPlayer("sfx_coin_double2.wav"); err == nil { |
| 209 | t.Error("Loaded a previously unloaded player.") |
| 210 | } else { |
| 211 | if !strings.HasPrefix(err.Error(), "resource not loaded by `FileLoader`:") { |
| 212 | t.Errorf("Unexpected error while loading previously unloaded player. Error was: %v\n", err) |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | func TestAudioPlayerURL(t *testing.T) { |
| 218 | engo.Files.SetRoot("testdata") |
nothing calls this directly
no test coverage detected