Skip to content

Commit 1db7b4c

Browse files
committed
#221 move unit tests to unity.
1 parent 36346c3 commit 1db7b4c

19 files changed

+117
-268
lines changed

test/baseRemoteTests.h

Lines changed: 0 additions & 178 deletions
This file was deleted.

test/CoreMenuItemTests.cpp renamed to test/test_core_items/CoreMenuItemTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <RuntimeMenuItem.h>
44
#include <RemoteMenuItem.h>
55
#include <RemoteAuthentication.h>
6-
#include "fixtures_extern.h"
6+
#include "../tutils/fixtures_extern.h"
77
#include <tcUtil.h>
88

99
RENDERING_CALLBACK_NAME_INVOKE(ipMenuItemTestCb, ipAddressRenderFn, "HelloWorld", 102, NULL)

test/DateTimeItemTestCases.cpp renamed to test/test_core_items/DateTimeItemTestCases.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include <unity.h>
33
#include <RuntimeMenuItem.h>
4-
#include "fixtures_extern.h"
4+
#include "../tutils/fixtures_extern.h"
55
#include <tcUtil.h>
66

77
void printMenuItem(MenuItem* menuItem);

test/LargeNumberItemTests.cpp renamed to test/test_core_items/LargeNumberItemTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <unity.h>
55
#include <RuntimeMenuItem.h>
66
#include <EditableLargeNumberMenuItem.h>
7-
#include "fixtures_extern.h"
7+
#include "../tutils/fixtures_extern.h"
88
#include <tcMenu.h>
99

1010
void dumpBuffer(LargeFixedNumber* buffer) {

test/RuntimeItemTestCases.cpp renamed to test/test_core_items/RuntimeItemTestCases.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <RuntimeMenuItem.h>
44
#include <RemoteMenuItem.h>
55
#include <RemoteAuthentication.h>
6-
#include "fixtures_extern.h"
6+
#include "../tutils/fixtures_extern.h"
77
#include <tcUtil.h>
88

99
bool renderActivateCalled = false;

test/ScrollChoiceMenuItemTests.cpp renamed to test/test_core_items/ScrollChoiceMenuItemTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <unity.h>
33
#include <RuntimeMenuItem.h>
44
#include <ScrollChoiceMenuItem.h>
5-
#include "fixtures_extern.h"
5+
#include "../tutils/fixtures_extern.h"
66
#include <tcMenu.h>
77
#include <IoLogging.h>
88

test/ValueItemTestCases.cpp renamed to test/test_core_items/ValueItemTestCases.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
#include <unity.h>
3-
#include "fixtures_extern.h"
3+
#include "../tutils/fixtures_extern.h"
44
#include <tcUtil.h>
55

66
void testCoreAndBooleanMenuItem() {
Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,13 @@
11
#include <unity.h>
22
#include <tcMenu.h>
3-
#include "fixtures_extern.h"
4-
5-
// core tests
6-
void testTcUtilGetParentAndVisit();
7-
void testIteratorGetSubMenu();
8-
void testGetItemById();
9-
void testIterationWithPredicate();
10-
void testIteratorTypePredicateLocalOnly();
11-
void testIteratorNothingMatchesPredicate();
12-
void testIterationOverAllMenuItems();
13-
void testIterationOnSimpleMenu();
3+
#include "../tutils/fixtures_extern.h"
144

155
// core menu item tests
166
void testIpAddressItem();
177
void testSettingIpItemDirectly();
188
void testFloatType();
199
void testAuthMenuItem();
2010

21-
// authentication tests
22-
void authenticationTest();
23-
void testNoAuthenicatorMode();
24-
void testProgmemAuthenicatorMode();
25-
26-
// dialog tests
27-
void testBaseDialogInfo();
28-
void testBaseDialogQuestion();
29-
30-
// core renderer tests
31-
void testEmptyItemPropertiesFactory();
32-
void testDefaultItemPropertiesFactory();
33-
void testSubAndItemSelectionPropertiesFactory();
34-
void testIconStorageAndRetrival();
35-
void testGridPositionStorageAndRetrival();
36-
void testWidgetFunctionality();
37-
void testBaseRendererWithDefaults();
38-
void testScrollingWithMoreThanOneItemOnRow();
39-
void testTakeOverDisplay();
40-
void testListRendering();
41-
4211
// Date time tests
4312
void testTimeMenuItem12Hr();
4413
void testTimeMenuItem24Hr();
@@ -64,12 +33,6 @@ void testColorMenuItemNoAlpha();
6433
void testColorMenuItemWithAlphaAndFn();
6534
void testColor32Struct();
6635

67-
// menu manager
68-
void testSaveAndLoadFromMenuSized();
69-
void testAddingItemsAndMenuCallbacks();
70-
void testCreatingAndInitialisation();
71-
void testNavigationPushAndPop();
72-
void testRebuildingNavigation();
7336

7437
// value item cases
7538
void testCoreAndBooleanMenuItem();
@@ -142,51 +105,12 @@ void setup() {
142105
RUN_TEST(testDateFormattedMenuItem);
143106
RUN_TEST(testDateLeapYearAndMonthSizes);
144107

145-
/* core */
146-
RUN_TEST(testTcUtilGetParentAndVisit);
147-
RUN_TEST(testIteratorGetSubMenu);
148-
RUN_TEST(testGetItemById);
149-
RUN_TEST(testIterationWithPredicate);
150-
RUN_TEST(testIteratorTypePredicateLocalOnly);
151-
RUN_TEST(testIteratorNothingMatchesPredicate);
152-
RUN_TEST(testIterationOverAllMenuItems);
153-
RUN_TEST(testIterationOnSimpleMenu);
154-
155-
/* base dialog */
156-
RUN_TEST(testBaseDialogInfo);
157-
RUN_TEST(testBaseDialogQuestion);
158-
159-
/* Authentication tests file */
160-
RUN_TEST(authenticationTest);
161-
RUN_TEST(testNoAuthenicatorMode);
162-
RUN_TEST(testProgmemAuthenicatorMode);
163-
164-
/* menu mgr and navigator */
165-
RUN_TEST(testSaveAndLoadFromMenuSized);
166-
RUN_TEST(testAddingItemsAndMenuCallbacks);
167-
RUN_TEST(testCreatingAndInitialisation);
168-
RUN_TEST(testNavigationPushAndPop);
169-
RUN_TEST(testRebuildingNavigation);
170-
171108
/* core item tests - keep last */
172109
RUN_TEST(testIpAddressItem);
173110
RUN_TEST(testSettingIpItemDirectly);
174111
RUN_TEST(testFloatType);
175112
RUN_TEST(testAuthMenuItem);
176113

177-
178-
/* core renderer - keep last */
179-
RUN_TEST(testEmptyItemPropertiesFactory);
180-
RUN_TEST(testDefaultItemPropertiesFactory);
181-
RUN_TEST(testSubAndItemSelectionPropertiesFactory);
182-
RUN_TEST(testIconStorageAndRetrival);
183-
RUN_TEST(testGridPositionStorageAndRetrival);
184-
RUN_TEST(testWidgetFunctionality);
185-
RUN_TEST(testBaseRendererWithDefaults);
186-
RUN_TEST(testScrollingWithMoreThanOneItemOnRow);
187-
RUN_TEST(testTakeOverDisplay);
188-
RUN_TEST(testListRendering);
189-
190114
UNITY_END();
191115
}
192116

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <unity.h>
33
#include <MockEepromAbstraction.h>
44
#include "RemoteAuthentication.h"
5-
#include "fixtures_extern.h"
5+
#include "../tutils/fixtures_extern.h"
66

77

88
void printAllAuthenticatorEntries(EepromAuthenticatorManager& authenticator, const char* why) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <MockIoAbstraction.h>
44
#include <BaseRenderers.h>
55
#include <MockEepromAbstraction.h>
6-
#include "fixtures_extern.h"
7-
#include "TestCapturingRenderer.h"
6+
#include "../tutils/fixtures_extern.h"
7+
#include "../tutils/TestCapturingRenderer.h"
88

99
extern MockedIoAbstraction mockIo;
1010
extern NoRenderer noRenderer;

0 commit comments

Comments
 (0)