Fixes unit tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
55cc0906c9
commit
1e43c07d43
|
@ -7,11 +7,11 @@ steps:
|
||||||
- name: test-debug-linux
|
- name: test-debug-linux
|
||||||
image: deukhoofd/linux64builder
|
image: deukhoofd/linux64builder
|
||||||
commands:
|
commands:
|
||||||
- cargo test --color=always
|
- cargo test --color=always -- --test-threads=1
|
||||||
- name: test-release-linux
|
- name: test-release-linux
|
||||||
image: deukhoofd/linux64builder
|
image: deukhoofd/linux64builder
|
||||||
commands:
|
commands:
|
||||||
- cargo test --release --color=always
|
- cargo test --release --color=always -- --test-threads=1
|
||||||
depends_on:
|
depends_on:
|
||||||
- test-debug-linux
|
- test-debug-linux
|
||||||
- name: test-miri-release-linux
|
- name: test-miri-release-linux
|
||||||
|
@ -28,7 +28,7 @@ steps:
|
||||||
RUSTFLAGS: -Zsanitizer=address
|
RUSTFLAGS: -Zsanitizer=address
|
||||||
RUSTDOCFLAGS: -Zsanitizer=address
|
RUSTDOCFLAGS: -Zsanitizer=address
|
||||||
commands:
|
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:
|
depends_on:
|
||||||
- test-debug-linux
|
- test-debug-linux
|
||||||
- name: test-coverage
|
- name: test-coverage
|
||||||
|
|
|
@ -792,17 +792,18 @@ pub mod test {
|
||||||
use crate::dynamic_data::models::pokemon::Pokemon;
|
use crate::dynamic_data::models::pokemon::Pokemon;
|
||||||
use crate::static_data::Gender;
|
use crate::static_data::Gender;
|
||||||
use crate::static_data::{AbilityIndex, DataLibrary};
|
use crate::static_data::{AbilityIndex, DataLibrary};
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn construct_pokemon() {
|
fn construct_pokemon() {
|
||||||
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
|
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
|
||||||
let species = lib.static_data().species().get(&"foo".into()).unwrap();
|
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
|
||||||
let form = species.get_form(&"default".into()).unwrap();
|
let form = species.get_form(&"default".into()).unwrap().clone();
|
||||||
|
|
||||||
let pokemon = Pokemon::new(
|
let pokemon = Pokemon::new(
|
||||||
&lib,
|
lib,
|
||||||
species,
|
species,
|
||||||
form,
|
&form,
|
||||||
AbilityIndex {
|
AbilityIndex {
|
||||||
hidden: false,
|
hidden: false,
|
||||||
index: 0,
|
index: 0,
|
||||||
|
|
|
@ -476,7 +476,7 @@ mod tests {
|
||||||
pub script: ScriptContainer,
|
pub script: ScriptContainer,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ScriptSource<'a> for TestScriptSource {
|
impl ScriptSource for TestScriptSource {
|
||||||
fn get_script_count(&self) -> usize {
|
fn get_script_count(&self) -> usize {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub mod tests {
|
||||||
let mut lib = AbilityLibrary::new(1);
|
let mut lib = AbilityLibrary::new(1);
|
||||||
lib.add(
|
lib.add(
|
||||||
&StringKey::new("test_ability"),
|
&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
|
// Drops borrow as mut
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ pub mod tests {
|
||||||
let m = build_item();
|
let m = build_item();
|
||||||
// Borrow as mut so we can insert
|
// Borrow as mut so we can insert
|
||||||
let w = &mut lib;
|
let w = &mut lib;
|
||||||
w.add(&"foo".into(), Box::from(m));
|
w.add(&"foo".into(), m);
|
||||||
// Drops borrow as mut
|
// Drops borrow as mut
|
||||||
|
|
||||||
lib
|
lib
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub mod tests {
|
||||||
let species = build_species();
|
let species = build_species();
|
||||||
// Borrow as mut so we can insert
|
// Borrow as mut so we can insert
|
||||||
let w = &mut lib;
|
let w = &mut lib;
|
||||||
w.add(&"foo".into(), Box::from(species));
|
w.add(&"foo".into(), species);
|
||||||
// Drops borrow as mut
|
// Drops borrow as mut
|
||||||
|
|
||||||
lib
|
lib
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue