|
12 | 12 | //
|
13 | 13 | // Description :
|
14 | 14 | //============================================================================
|
15 |
| -#include <iostream> |
16 |
| -#include <unistd.h> |
17 |
| - |
| 15 | +#include <boost/filesystem/operations.hpp> |
| 16 | +#include <boost/filesystem/path.hpp> |
18 | 17 | #include <boost/test/unit_test.hpp>
|
19 |
| -#include "boost/filesystem/operations.hpp" |
20 |
| -#include "boost/filesystem/path.hpp" |
| 18 | +#include <iostream> |
21 | 19 |
|
22 |
| -#include "PasswdFile.hpp" |
23 | 20 | #include "File.hpp"
|
| 21 | +#include "PasswdFile.hpp" |
| 22 | +#include "PasswordEncryption.hpp" |
24 | 23 |
|
25 | 24 | namespace fs = boost::filesystem;
|
26 | 25 | using namespace std;
|
@@ -146,11 +145,11 @@ BOOST_AUTO_TEST_CASE( test_passwd )
|
146 | 145 | // tom host3 3143 x12ggg # sdsdsd
|
147 | 146 |
|
148 | 147 | std::vector<Pass_wd> expected_passwds;
|
149 |
| - expected_passwds.emplace_back("fred", "host", "3141", crypt("x12ggg","fred") ); |
150 |
| - expected_passwds.emplace_back("fred", "host3", "3143", crypt("passwd","fred") ); |
151 |
| - expected_passwds.emplace_back("fred", "host4", "3145", crypt("x12ggg","fred") ); |
152 |
| - expected_passwds.emplace_back("jake", "host", "3141", crypt("x12ggg","jake") ); |
153 |
| - expected_passwds.emplace_back("tom", "host3", "3143", crypt("x12ggg","tom") ); |
| 148 | + expected_passwds.emplace_back("fred", "host", "3141", PasswordEncryption::encrypt("x12ggg","fred") ); |
| 149 | + expected_passwds.emplace_back("fred", "host3", "3143", PasswordEncryption::encrypt("passwd","fred") ); |
| 150 | + expected_passwds.emplace_back("fred", "host4", "3145", PasswordEncryption::encrypt("x12ggg","fred") ); |
| 151 | + expected_passwds.emplace_back("jake", "host", "3141", PasswordEncryption::encrypt("x12ggg","jake") ); |
| 152 | + expected_passwds.emplace_back("tom", "host3", "3143", PasswordEncryption::encrypt("x12ggg","tom") ); |
154 | 153 |
|
155 | 154 | BOOST_REQUIRE_MESSAGE(expected_passwds == theFile.passwds() ,"expected passwords to match");
|
156 | 155 | }
|
|
0 commit comments