gtest: Added Google Test

Added Google Test for unit testing.  Currently NOT required by UPM
CMake.

    * Added a test fixture for the utilities library.
    * Fixed bug in delay methods provided by utilities library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2018-03-02 11:45:15 -08:00
parent c54d6de054
commit 92b0919f56
4 changed files with 94 additions and 6 deletions

View File

@ -52,8 +52,9 @@ static struct aqi {
void upm_delay(unsigned int time)
{
if (time <= 0)
time = 1;
/* Return if time == 0 */
if (!time)
return;
#if defined(UPM_PLATFORM_LINUX)
@ -92,8 +93,9 @@ void upm_delay(unsigned int time)
void upm_delay_ms(unsigned int time)
{
if (time <= 0)
time = 1;
/* Return if time == 0 */
if (!time)
return;
#if defined(UPM_PLATFORM_LINUX)
@ -128,8 +130,9 @@ void upm_delay_ms(unsigned int time)
void upm_delay_us(unsigned int time)
{
if (time <= 0)
time = 1;
/* Return if time == 0 */
if (!time)
return;
#if defined(UPM_PLATFORM_LINUX)