Commit facf4f9bbb2433affadc3336780db0b8b13289d4
1 parent
845fdf99
Exists in
master
Criado testcoletaIdOs().
Showing
2 changed files
with
10 additions
and
0 deletions
Show diff stats
cacic-teste/testcacic.cpp
@@ -86,6 +86,14 @@ void CTestCacic::testInterfaceDeRede(){ | @@ -86,6 +86,14 @@ void CTestCacic::testInterfaceDeRede(){ | ||
86 | QVERIFY2(!OCacicComp.getNetworkInterface().empty(), "Nenhuma interface de rede encontrada."); | 86 | QVERIFY2(!OCacicComp.getNetworkInterface().empty(), "Nenhuma interface de rede encontrada."); |
87 | } | 87 | } |
88 | 88 | ||
89 | +void CTestCacic::testcoletaIdOs(){ | ||
90 | + // instancia um OperatingSystem que invoca coletaIdOs() no construtor | ||
91 | + OperatingSystem OS; | ||
92 | + | ||
93 | +// QVERIFY(OS.getIdOs() == OperatingSystem::LINUX_ARCH); | ||
94 | + QVERIFY(OS.getIdOs() != -1); | ||
95 | +} | ||
96 | + | ||
89 | void CTestCacic::testpegarOS(){ | 97 | void CTestCacic::testpegarOS(){ |
90 | //basta que seja um retorno válido, não precisa validar todos. | 98 | //basta que seja um retorno válido, não precisa validar todos. |
91 | QVERIFY(OCacicComp.getOs().getIdOs() != -1 ); | 99 | QVERIFY(OCacicComp.getOs().getIdOs() != -1 ); |
cacic-teste/testcacic.h
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | #include <ccacic.h> | 5 | #include <ccacic.h> |
6 | #include <cacic_computer.h> | 6 | #include <cacic_computer.h> |
7 | #include <console.h> | 7 | #include <console.h> |
8 | +#include <operatingsystem.h> | ||
8 | #include <QtTest/QtTest> | 9 | #include <QtTest/QtTest> |
9 | #include <QDebug> | 10 | #include <QDebug> |
10 | #include <QList> | 11 | #include <QList> |
@@ -47,6 +48,7 @@ private slots: | @@ -47,6 +48,7 @@ private slots: | ||
47 | void testConsole(); | 48 | void testConsole(); |
48 | void testPegarUsu(); | 49 | void testPegarUsu(); |
49 | void testJsonValueFromJsonString(); | 50 | void testJsonValueFromJsonString(); |
51 | + void testcoletaIdOs(); | ||
50 | void testpegarOS(); | 52 | void testpegarOS(); |
51 | void testLogin(); | 53 | void testLogin(); |
52 | void testSslConnection(); | 54 | void testSslConnection(); |