From e43e9bd26173c88125bbf5d64fd1c0f616baab36 Mon Sep 17 00:00:00 2001 From: Yoonsang Lee Date: Mon, 29 Jun 2015 10:16:43 +0900 Subject: [PATCH] Remove Random::Chance() Change-Id: Ib78940c744e5d9c689c7cecb44815d07e133e1af --- automated-tests/src/dali/utc-Dali-Random.cpp | 39 ---------------------------- dali/public-api/math/random.h | 11 -------- 2 files changed, 50 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-Random.cpp b/automated-tests/src/dali/utc-Dali-Random.cpp index 3b68d76..a3c8670 100644 --- a/automated-tests/src/dali/utc-Dali-Random.cpp +++ b/automated-tests/src/dali/utc-Dali-Random.cpp @@ -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; -} diff --git a/dali/public-api/math/random.h b/dali/public-api/math/random.h index 240c58b..9b9e97e 100644 --- a/dali/public-api/math/random.h +++ b/dali/public-api/math/random.h @@ -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 -- 2.7.4