Skip to content

Commit

Permalink
refactor(test_suite): address the "field is never read" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Jul 9, 2020
1 parent 16ed714 commit 2e15b31
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
9 changes: 6 additions & 3 deletions src/constance_test_suite/src/kernel_tests/basic.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
//! Runs a task at startup.
use constance::{kernel::Task, prelude::*};
use core::marker::PhantomData;

use super::Driver;

pub struct App<System> {
task: Task<System>,
_phantom: PhantomData<System>,
}

impl<System: Kernel> App<System> {
constance::configure! {
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };

App { task }
App {
_phantom: PhantomData,
}
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/constance_test_suite/src/kernel_tests/cpu_lock.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
//! Activates and deactivates CPU Lock.
use constance::{kernel::Task, prelude::*};
use core::marker::PhantomData;

use super::Driver;

pub struct App<System> {
task: Task<System>,
_phantom: PhantomData<System>,
}

impl<System: Kernel> App<System> {
constance::configure! {
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };

App { task }
App {
_phantom: PhantomData,
}
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/constance_test_suite/src/kernel_tests/priority_boost.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
//! Activates and deactivates Priority Boost.
use constance::{kernel::Task, prelude::*};
use core::marker::PhantomData;

use super::Driver;

pub struct App<System> {
task: Task<System>,
_phantom: PhantomData<System>,
}

impl<System: Kernel> App<System> {
constance::configure! {
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };

App { task }
App {
_phantom: PhantomData,
}
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/constance_test_suite/src/kernel_tests/time_misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ use constance::{
prelude::*,
time::{Duration, Time},
};
use core::marker::PhantomData;

use super::Driver;

pub struct App<System> {
task: Task<System>,
_phantom: PhantomData<System>,
}

impl<System: Kernel> App<System> {
constance::configure! {
pub const fn new<D: Driver<Self>>(_: &mut CfgBuilder<System>) -> Self {
let task = new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };
new! { Task<_>, start = task_body::<System, D>, priority = 0, active = true };

App { task }
App { _phantom: PhantomData }
}
}
}
Expand Down

0 comments on commit 2e15b31

Please sign in to comment.