From d8e56f86949341561142ad848b4dbe1056b4197b Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sun, 28 Oct 2018 13:15:18 +0100 Subject: [PATCH] Add tests for 12h PM hours --- tests/ds323x.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ds323x.rs b/tests/ds323x.rs index d2ffc56..fc45009 100644 --- a/tests/ds323x.rs +++ b/tests/ds323x.rs @@ -79,3 +79,19 @@ mod hours_12h_am { set_invalid_param_test!(set_hours, Hours::AM(13)); } } + +mod hours_12h_pm { + use super::*; + get_param_test!(get_hours, HOURS, Hours::PM(12), 0b0111_0010); + set_param_test!(set_hours, HOURS, Hours::PM(12), 0b0111_0010); + + mod too_small { + use super::*; + set_invalid_param_test!(set_hours, Hours::PM(0)); + } + + mod too_big { + use super::*; + set_invalid_param_test!(set_hours, Hours::PM(13)); + } +}