Fixes unit tests
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2022-08-20 13:26:06 +02:00
parent 55cc0906c9
commit 1e43c07d43
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
7 changed files with 12 additions and 11 deletions

View File

@ -7,11 +7,11 @@ steps:
- name: test-debug-linux
image: deukhoofd/linux64builder
commands:
- cargo test --color=always
- cargo test --color=always -- --test-threads=1
- name: test-release-linux
image: deukhoofd/linux64builder
commands:
- cargo test --release --color=always
- cargo test --release --color=always -- --test-threads=1
depends_on:
- test-debug-linux
- name: test-miri-release-linux
@ -28,7 +28,7 @@ steps:
RUSTFLAGS: -Zsanitizer=address
RUSTDOCFLAGS: -Zsanitizer=address
commands:
- cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --color=always
- cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --color=always -- --test-threads=1
depends_on:
- test-debug-linux
- name: test-coverage

View File

@ -792,17 +792,18 @@ pub mod test {
use crate::dynamic_data::models::pokemon::Pokemon;
use crate::static_data::Gender;
use crate::static_data::{AbilityIndex, DataLibrary};
use std::sync::Arc;
#[test]
fn construct_pokemon() {
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
let species = lib.static_data().species().get(&"foo".into()).unwrap();
let form = species.get_form(&"default".into()).unwrap();
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
let form = species.get_form(&"default".into()).unwrap().clone();
let pokemon = Pokemon::new(
&lib,
lib,
species,
form,
&form,
AbilityIndex {
hidden: false,
index: 0,

View File

@ -476,7 +476,7 @@ mod tests {
pub script: ScriptContainer,
}
impl<'a> ScriptSource<'a> for TestScriptSource {
impl ScriptSource for TestScriptSource {
fn get_script_count(&self) -> usize {
1
}

View File

@ -42,7 +42,7 @@ pub mod tests {
let mut lib = AbilityLibrary::new(1);
lib.add(
&StringKey::new("test_ability"),
Box::new(Ability::new(&"test_ability".into(), &"test_ability".into(), Vec::new())),
Ability::new(&"test_ability".into(), &"test_ability".into(), Vec::new()),
);
// Drops borrow as mut

View File

@ -57,7 +57,7 @@ pub mod tests {
let m = build_item();
// Borrow as mut so we can insert
let w = &mut lib;
w.add(&"foo".into(), Box::from(m));
w.add(&"foo".into(), m);
// Drops borrow as mut
lib

View File

@ -71,7 +71,7 @@ pub mod tests {
let species = build_species();
// Borrow as mut so we can insert
let w = &mut lib;
w.add(&"foo".into(), Box::from(species));
w.add(&"foo".into(), species);
// Drops borrow as mut
lib

Binary file not shown.