Mercurial > public > cpp-enigma
diff enigma/tests/test_plugboard.t.h @ 10:232dbe7a3fe0
Added plugboard::unplug_all().
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 29 Jun 2012 21:26:24 -0500 |
parents | 7362965f53b1 |
children | b9d124a15926 |
line wrap: on
line diff
--- a/enigma/tests/test_plugboard.t.h Fri Jun 29 21:19:00 2012 -0500 +++ b/enigma/tests/test_plugboard.t.h Fri Jun 29 21:26:24 2012 -0500 @@ -307,4 +307,22 @@ } } + void test_unplug_all() + { + plugboard pb; + pb.connect(5, 7); + pb.connect(1, 20); + pb.connect(18, 24); + pb.unplug_all(); + for (int i = 0; i < 26; ++i) + { + TS_ASSERT(pb.is_free(i)); + } + pb.unplug_all(); + for (int i = 0; i < 26; ++i) + { + TS_ASSERT(pb.is_free(i)); + } + } + };