| 1 | #include "testhostinfo.h" |
| 2 | #include "hostinfo.h" |
| 3 | #include <QtDebug> |
| 4 | |
| 5 | using namespace QTerm; |
| 6 | |
| 7 | void TestHostInfo::testHostInfo() |
| 8 | { |
| 9 | HostInfo hostinfo("newsmth.net", 22); |
| 10 | QVERIFY(hostinfo.hostName() == "newsmth.net"); |
| 11 | } |
| 12 | |
| 13 | void TestHostInfo::testSSHHostInfo() |
| 14 | { |
| 15 | SSHInfo hostinfo("newsmth.net", 22); |
| 16 | hostinfo.setUserName("hooey"); |
| 17 | Completion completion; |
| 18 | completion["who"]="Lu Ran"; |
| 19 | completion["test"]="Temp"; |
| 20 | hostinfo.setAutoCompletion(completion); |
| 21 | bool test=false; |
| 22 | QVERIFY(hostinfo.userName(&test) == "hooey"); |
| 23 | QVERIFY(test); |
| 24 | QVERIFY(hostinfo.answer("test") == "Temp"); |
| 25 | QVERIFY(hostinfo.userName(&test) == "hooey"); |
| 26 | } |
| 27 | QTEST_MAIN(TestHostInfo) |
| 28 | #include "testhostinfo.moc" |