framework/c/inc/le_test.h File Reference

Go to the source code of this file.

Defines

#define LE_TEST_INIT   _le_test_Init()
#define LE_TEST(testResult)
#define LE_TEST_SUMMARY   exit(_le_test_GetNumFailures());
#define LE_TEST_NUM_FAILURES   _le_test_GetNumFailures()

Functions

Local definitions that should not be used directly.
void _le_test_Init (void)
void _le_test_Fail (void)
int _le_test_GetNumFailures (void)

Detailed Description

Legato Unit Testing API include file.

Copyright (C) Sierra Wireless, Inc. 2013. All rights reserved. Use of this work is subject to license.


Define Documentation

#define LE_TEST (   testResult)
Value:
if (testResult) \
                                    { \
                                        LE_INFO("Unit Test Passed: '%s'", #testResult); \
                                    } \
                                    else \
                                    { \
                                        LE_ERROR("Unit Test Failed: '%s'", #testResult); \
                                        _le_test_Fail(); \
                                    }

Performs the test. If the test fails (testResult == false) then an error message is logged and the process either exits or the number of test failures is incremented depending on the operating mode. If the test passes (testResult == true) then an info message is logged and this macro just returns.

#define LE_TEST_INIT   _le_test_Init()

Initializes the testing framework. Must be called once before any tests are performed.

#define LE_TEST_NUM_FAILURES   _le_test_GetNumFailures()

Number of failed tests.

#define LE_TEST_SUMMARY   exit(_le_test_GetNumFailures());

Exits the process and returns the number of failed tests.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines