resource: Fix build break on randomtest
authorDan Mihai <Daniel.Mihai@microsoft.com>
Wed, 14 Dec 2016 16:17:08 +0000 (08:17 -0800)
committerPhil Coval <philippe.coval@osg.samsung.com>
Wed, 14 Dec 2016 18:31:19 +0000 (18:31 +0000)
Fix conflict between commits 80a131603151b1666c092ac03e76af399b500b9d
and 4333f4c5cc1578449afbc04dce1bd890f7017cfa.

Change-Id: I29b343b92b27fd819bac0275bfbc4ae1b931cb23
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Origin: https://gerrit.iotivity.org/gerrit/#/c/15619/
Reviewed-on: https://gerrit.iotivity.org/gerrit/15619
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: Phil Coval <philippe.coval@osg.samsung.com>
resource/c_common/ocrandom/test/randomtest.cpp

index 3f9c535..5036113 100644 (file)
@@ -52,10 +52,11 @@ TEST(RandomGeneration,OCGetRandomBytes) {
 // random number generator.
 TEST(RandomGeneration,OCFillRandomMem_GeneratedDataIsDifferent) {
     uint8_t array[ARR_SIZE] = {};
-    uint8_t matchingByte = OCGetRandomByte();
     bool foundNonMatchingByte = false;
+    uint8_t matchingByte;
+    EXPECT_TRUE(OCGetRandomBytes(&matchingByte, 1));
 
-    OCFillRandomMem(array, ARR_SIZE);
+    EXPECT_TRUE(OCGetRandomBytes(array, sizeof(array)));
 
     // Note: this test can flag a false-failure, but this is
     // statistically very unlikely to fail.  In a uniformly distributed