summaryrefslogtreecommitdiff
path: root/unittests/Support/ProcessTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commit5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /unittests/Support/ProcessTest.cpp
parent68bcb7db193e4bc81430063148253d30a791023e (diff)
Notes
Diffstat (limited to 'unittests/Support/ProcessTest.cpp')
-rw-r--r--unittests/Support/ProcessTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/unittests/Support/ProcessTest.cpp b/unittests/Support/ProcessTest.cpp
index 27c2318215d6..f4060720961b 100644
--- a/unittests/Support/ProcessTest.cpp
+++ b/unittests/Support/ProcessTest.cpp
@@ -11,7 +11,7 @@
#include "gtest/gtest.h"
#ifdef LLVM_ON_WIN32
-#include "windows.h"
+#include <windows.h>
#endif
namespace {
@@ -39,6 +39,13 @@ TEST(ProcessTest, SelfProcess) {
EXPECT_GT(TimeValue::MaxTime, process::get_self()->get_wall_time());
}
+TEST(ProcessTest, GetRandomNumberTest) {
+ const unsigned r1 = Process::GetRandomNumber();
+ const unsigned r2 = Process::GetRandomNumber();
+ // It should be extremely unlikely that both r1 and r2 are 0.
+ EXPECT_NE((r1 | r2), 0u);
+}
+
#ifdef _MSC_VER
#define setenv(name, var, ignore) _putenv_s(name, var)
#endif