comparison enigma/tests/test_machine.t.h @ 7:db1216d380b3

Added a set_rotor() that takes a string for convenience.
author Brian Neal <bgneal@gmail.com>
date Fri, 29 Jun 2012 20:08:10 -0500
parents 2792ca4ffa84
children b90a41f0cd94
comparison
equal deleted inserted replaced
6:3370383116db 7:db1216d380b3
11 #include "machine.h" 11 #include "machine.h"
12 #include "enigma_utils.h" 12 #include "enigma_utils.h"
13 13
14 using namespace enigma; 14 using namespace enigma;
15 15
16
17 class display_suite : public CxxTest::TestSuite
18 {
19 public:
20
21 void test_set_display3()
22 {
23 enigma_machine m({"II", "IV", "V"}, {}, "B");
24 TS_ASSERT_THROWS(m.set_display("ABCD"), enigma_machine_error);
25 TS_ASSERT_THROWS_NOTHING(m.set_display("ABC"));
26 }
27
28 void test_set_display4()
29 {
30 enigma_machine m({"Gamma", "II", "IV", "V"}, {}, "B-Thin");
31 TS_ASSERT_THROWS(m.set_display("BCD"), enigma_machine_error);
32 TS_ASSERT_THROWS_NOTHING(m.set_display("ABCD"));
33 }
34 };
16 35
17 class stepping_test_suite : public CxxTest::TestSuite 36 class stepping_test_suite : public CxxTest::TestSuite
18 { 37 {
19 public: 38 public:
20 39