#ifndef __LIBUI_UNIT_H__ #define __LIBUI_UNIT_H__ #include #include #include #include #include #include "../../ui.h" /** * Unit test run functions. */ int initRunUnitTests(void); int sliderRunUnitTests(void); int spinboxRunUnitTests(void); int labelRunUnitTests(void); int buttonRunUnitTests(void); int comboboxRunUnitTests(void); int checkboxRunUnitTests(void); int radioButtonsRunUnitTests(void); /** * Helper for general setup/teardown of controls embedded in a window. */ struct state { uiWindow *w; uiControl *c; }; /** * Helper for setting up the state variable used in unit tests. */ int unitTestsSetup(void **state); /** * Helper for tearing down unitTestsSetup(). */ int unitTestsTeardown(void **state); /** * Helper for creating a window used in unit tests and displaying a control. * * Use #uiControlPtrFromState to assign your test control: * * uiControl **c uiControlPtrFromState(uiControl, state); */ int unitTestSetup(void **state); /** * Helper for tearing down unitTestSetup(). */ int unitTestTeardown(void **state); #define uiControlPtrFromState(t, s) (t**)&(((struct state *)*(s))->c) #endif