diff options
Diffstat (limited to 'libraries/ganalytics/src')
-rw-r--r-- | libraries/ganalytics/src/sys_test.cpp | 22 | ||||
-rw-r--r-- | libraries/ganalytics/src/sys_win32.cpp | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/libraries/ganalytics/src/sys_test.cpp b/libraries/ganalytics/src/sys_test.cpp new file mode 100644 index 00000000..6221da45 --- /dev/null +++ b/libraries/ganalytics/src/sys_test.cpp @@ -0,0 +1,22 @@ +#include <QTest> +#include "TestUtil.h" + +#include <sys.h> + +class SysTest : public QObject +{ + Q_OBJECT +private +slots: + + void test_kernelNotNull() + { + auto kinfo = Sys::getKernelInfo(); + QVERIFY(!kinfo.kernelName.isEmpty()); + QVERIFY(kinfo.kernelVersion != "0.0"); + } +}; + +QTEST_GUILESS_MAIN(SysTest) + +#include "sys_test.moc" diff --git a/libraries/ganalytics/src/sys_win32.cpp b/libraries/ganalytics/src/sys_win32.cpp index 4d43169b..502b980d 100644 --- a/libraries/ganalytics/src/sys_win32.cpp +++ b/libraries/ganalytics/src/sys_win32.cpp @@ -8,6 +8,7 @@ Sys::KernelInfo Sys::getKernelInfo() out.kernelName = "Windows"; OSVERSIONINFOW osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFOW)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&osvi); out.kernelVersion = QString("%1.%2").arg(osvi.dwMajorVersion).arg(osvi.dwMinorVersion); return out; |