Merge "Remove Random::Chance()" into devel/master
authorHyunJu Shin <hyunjushin@samsung.com>
Mon, 29 Jun 2015 10:03:14 +0000 (03:03 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 29 Jun 2015 10:03:14 +0000 (03:03 -0700)
automated-tests/src/dali/utc-Dali-Random.cpp
dali/public-api/math/random.h

index 3b68d76..a3c8670 100644 (file)
@@ -56,42 +56,3 @@ int UtcDaliRandomAxisMethod(void)
   }
   END_TEST;
 }
-
-int UtcDaliRandomChanceMethod(void)
-{
-  int bin_zero=0, bin_one=0;
-
-  for(size_t i=0; i<100000; i++)
-  {
-    bool chance = Dali::Random::Chance();
-    if(chance)
-    {
-      bin_one++;
-    }
-    else
-    {
-      bin_zero++;
-    }
-  }
-  // Check distribution
-  DALI_TEST_EQUALS((float)bin_zero / (float)bin_one, 1.0f, 0.1f, TEST_LOCATION);
-
-  bin_zero=0; bin_one = 0;
-  for(size_t i=0; i<100000; i++)
-  {
-    bool chance = Dali::Random::Chance(0.25);
-    if(chance) {bin_one++;} else {bin_zero++;}
-  }
-  // Check distribution
-  DALI_TEST_EQUALS((float)bin_zero / (float)bin_one, 3.0f, 0.1f, TEST_LOCATION);
-
-  bin_zero=0; bin_one = 0;
-  for(size_t i=0; i<100000; i++)
-  {
-    bool chance = Dali::Random::Chance(0.1);
-    if(chance) {bin_one++;} else {bin_zero++;}
-  }
-  // Check distribution
-  DALI_TEST_EQUALS((float)bin_zero / (float)bin_one, 9.0f, 0.1f, TEST_LOCATION);
-  END_TEST;
-}
index 240c58b..9b9e97e 100644 (file)
@@ -66,17 +66,6 @@ inline Vector4 Axis()
   return axis;
 }
 
-/**
- * @brief Returns true if the value given is greater than a random value between 0 and 1.
- *
- * @param chance  A value between 0 and 1. [Default: 0.5]
- * @return        true if chance greater than the random value, otherwise false.
- */
-inline bool Chance(float chance = 0.5f)
-{
-  return chance > Range(0.0f, 1.0f);
-}
-
 } // namespace Random
 
 } // namespace Dali