Skip to content

Commit a4a9afd

Browse files
change structs for objc side
1 parent a78d592 commit a4a9afd

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

code/logic/fossil/pizza/mock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ FOSSIL_PIZZA_API bool fossil_mock_compare_output(const char *captured, const cha
229229
struct name
230230
#else
231231
#define _FOSSIL_MOCK_STRUCT(name) \
232-
typedef struct name name; \
233-
struct name
232+
typedef struct name
234233
#endif
235234

236235
/**

code/tests/cases/test_mock.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
FOSSIL_MOCK_STRUCT(MockStruct) {
4343
int a;
4444
char b;
45-
};
45+
} MockStruct;
4646

4747
// Example of creating a mock function using the macro
4848
FOSSIL_MOCK_FUNC(int, objc_mock_function, int a, int b) {

code/tests/cases/test_sample.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#include "fossil/pizza/framework.h"
1717

1818
// Test data structure for a sample test
19-
FOSSIL_MOCK_STRUCT(CppSampleTestData) {
19+
FOSSIL_MOCK_STRUCT(ObjCSampleTestData) {
2020
int input;
2121
int expected_output;
22-
};
22+
} ObjCSampleTestData;
2323

2424
// Setup function for the test suite
2525
FOSSIL_SETUP(objc_sample_suite) {
@@ -36,7 +36,7 @@
3636

3737
// A simple test case to check if input + 1 equals expected_output
3838
FOSSIL_TEST(objc_test_input_increment) {
39-
CppSampleTestData data = {5, 6}; // Simplified initialization
39+
ObjCSampleTestData data = {5, 6}; // Simplified initialization
4040

4141
int actual_output = data.input + 1;
4242

@@ -45,7 +45,7 @@
4545

4646
// A simple test case to check if input - 1 equals expected_output
4747
FOSSIL_TEST(objc_test_input_decrement) {
48-
CppSampleTestData data = {5, 4}; // Simplified initialization
48+
ObjCSampleTestData data = {5, 4}; // Simplified initialization
4949

5050
int actual_output = data.input - 1;
5151

@@ -54,7 +54,7 @@
5454

5555
// A simple test case to check if input * 2 equals expected_output
5656
FOSSIL_TEST(objc_test_input_double) {
57-
CppSampleTestData data = {5, 10}; // Simplified initialization
57+
ObjCSampleTestData data = {5, 10}; // Simplified initialization
5858

5959
int actual_output = data.input * 2;
6060

@@ -63,7 +63,7 @@
6363

6464
// A simple test case to check if input / 2 equals expected_output
6565
FOSSIL_TEST(objc_test_input_half) {
66-
CppSampleTestData data = {10, 5}; // Simplified initialization
66+
ObjCSampleTestData data = {10, 5}; // Simplified initialization
6767

6868
int actual_output = data.input / 2;
6969

@@ -72,7 +72,7 @@
7272

7373
// A simple test case to check if input % 2 equals expected_output
7474
FOSSIL_TEST(objc_test_input_modulo) {
75-
CppSampleTestData data = { 5, 1 };
75+
ObjCSampleTestData data = { 5, 1 };
7676

7777
int actual_output = data.input % 2;
7878

@@ -81,7 +81,7 @@
8181

8282
// A simple test case to check if input squared equals expected_output
8383
FOSSIL_TEST(objc_test_input_square) {
84-
CppSampleTestData data = { 3, 9 };
84+
ObjCSampleTestData data = { 3, 9 };
8585

8686
int actual_output = data.input * data.input;
8787

@@ -90,7 +90,7 @@
9090

9191
// A simple test case to check if input is equal to expected_output
9292
FOSSIL_TEST(objc_test_input_equal) {
93-
CppSampleTestData data = { 7, 7 };
93+
ObjCSampleTestData data = { 7, 7 };
9494

9595
int actual_output = data.input;
9696

code/tests/cases/test_sample.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "fossil/pizza/framework.h"
1717

1818
// Test data structure for a sample test
19-
FOSSIL_MOCK_STRUCT(CppSampleTestData) {
19+
FOSSIL_MOCK_STRUCT(ObjCppSampleTestData) {
2020
int input;
2121
int expected_output;
2222
};
@@ -36,7 +36,7 @@
3636

3737
// A simple test case to check if input + 1 equals expected_output
3838
FOSSIL_TEST(objcpp_test_input_increment) {
39-
CppSampleTestData data = {5, 6}; // Simplified initialization
39+
ObjCppSampleTestData data = {5, 6}; // Simplified initialization
4040

4141
int actual_output = data.input + 1;
4242

@@ -45,7 +45,7 @@
4545

4646
// A simple test case to check if input - 1 equals expected_output
4747
FOSSIL_TEST(objcpp_test_input_decrement) {
48-
CppSampleTestData data = {5, 4}; // Simplified initialization
48+
ObjCppSampleTestData data = {5, 4}; // Simplified initialization
4949

5050
int actual_output = data.input - 1;
5151

@@ -54,7 +54,7 @@
5454

5555
// A simple test case to check if input * 2 equals expected_output
5656
FOSSIL_TEST(objcpp_test_input_double) {
57-
CppSampleTestData data = {5, 10}; // Simplified initialization
57+
ObjCppSampleTestData data = {5, 10}; // Simplified initialization
5858

5959
int actual_output = data.input * 2;
6060

@@ -63,7 +63,7 @@
6363

6464
// A simple test case to check if input / 2 equals expected_output
6565
FOSSIL_TEST(objcpp_test_input_half) {
66-
CppSampleTestData data = {10, 5}; // Simplified initialization
66+
ObjCppSampleTestData data = {10, 5}; // Simplified initialization
6767

6868
int actual_output = data.input / 2;
6969

@@ -72,7 +72,7 @@
7272

7373
// A simple test case to check if input % 2 equals expected_output
7474
FOSSIL_TEST(objcpp_test_input_modulo) {
75-
CppSampleTestData data = { 5, 1 };
75+
ObjCppSampleTestData data = { 5, 1 };
7676

7777
int actual_output = data.input % 2;
7878

@@ -81,7 +81,7 @@
8181

8282
// A simple test case to check if input squared equals expected_output
8383
FOSSIL_TEST(objcpp_test_input_square) {
84-
CppSampleTestData data = { 3, 9 };
84+
ObjCppSampleTestData data = { 3, 9 };
8585

8686
int actual_output = data.input * data.input;
8787

@@ -90,7 +90,7 @@
9090

9191
// A simple test case to check if input is equal to expected_output
9292
FOSSIL_TEST(objcpp_test_input_equal) {
93-
CppSampleTestData data = { 7, 7 };
93+
ObjCppSampleTestData data = { 7, 7 };
9494

9595
int actual_output = data.input;
9696

0 commit comments

Comments
 (0)