Skip to content

Commit

Permalink
Fix Random + add test
Browse files Browse the repository at this point in the history
  • Loading branch information
dz333n committed Aug 1, 2019
1 parent b352aa4 commit 2533081
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 0 additions & 3 deletions COREDLL/winbase_wcecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ BOOL WINAPI VirtualFree_WCECL(

DWORD WINAPI Random()
{
// sources: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms860353(v%3Dmsdn.10)
// https://docs.microsoft.com/en-us/previous-versions/ms910957(v=msdn.10)
srand((unsigned)GetTickCount());
int result = rand();
return result;
}
Expand Down
17 changes: 15 additions & 2 deletions CoredllTest/CoredllTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@
#include "pch.h"
#include <iostream>

void RandomTest(int number)
{
printf("Testing Random #%i:\n", number);
printf("%i", Random());
for (int i = 0; i < 50; i++)
printf(", %i", Random());
printf("\n");
}

int main()
{
printf("%i\n", RegisterDefaultGestureHandler());
printf("%i\n", Random());
printf("Testing unimplemented RegisterDefaultGestureHandler:\n");
printf("%i\n\n", RegisterDefaultGestureHandler());
RandomTest(1);
printf("Wait 2500 ms...\n");
Sleep(2500);
RandomTest(2);
}

0 comments on commit 2533081

Please sign in to comment.