|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73815 - sandbox/SOC/2011/checks/libs/checks/test
From: pierre.talbot.6114_at_[hidden]
Date: 2011-08-16 05:43:47
Author: trademark
Date: 2011-08-16 05:43:46 EDT (Tue, 16 Aug 2011)
New Revision: 73815
URL: http://svn.boost.org/trac/boost/changeset/73815
Log:
Add the modulus 11 transposition tests.
Text files modified:
sandbox/SOC/2011/checks/libs/checks/test/test_checks.cpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
Modified: sandbox/SOC/2011/checks/libs/checks/test/test_checks.cpp
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/test/test_checks.cpp (original)
+++ sandbox/SOC/2011/checks/libs/checks/test/test_checks.cpp 2011-08-16 05:43:46 EDT (Tue, 16 Aug 2011)
@@ -49,6 +49,15 @@
}
};
+struct modulus11_functor
+{
+ template <typename range>
+ typename boost::checks::mod11_compute_algorithm::checkdigit<range>::type operator ()( const range &check_range ) const
+ {
+ return boost::checks::compute_modulus11( check_range ) ;
+ }
+};
+
BOOST_AUTO_TEST_CASE(luhn_test)
{
unsigned int transpositions_failures = transposition( luhn_functor() ) ;
@@ -59,4 +68,10 @@
{
unsigned int transpositions_failures = transposition( verhoeff_functor() ) ;
BOOST_CHECK_MESSAGE( transpositions_failures == 0, "" << transpositions_failures << " catched on 90.") ;
+}
+
+BOOST_AUTO_TEST_CASE(modulus11_test)
+{
+ unsigned int transpositions_failures = transposition( modulus11_functor() ) ;
+ BOOST_CHECK_MESSAGE( transpositions_failures == 0, "" << transpositions_failures << " catched on 90.") ;
}
\ No newline at end of file
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk