Skip to content

Commit fb0f201

Browse files
rename test data objects from both sample files
1 parent 6a78c5d commit fb0f201

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

code/tests/cases/test_sample.c

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

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

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

3737
// A simple test case to check if input + 1 equals expected_output
3838
FOSSIL_TEST_CASE(test_input_increment) {
39-
SampleTestData data = { .input = 5, .expected_output = 6 };
39+
CSampleTestData data = { .input = 5, .expected_output = 6 };
4040

4141
int actual_output = data.input + 1;
4242

@@ -45,7 +45,7 @@ FOSSIL_TEST_CASE(test_input_increment) {
4545

4646
// A simple test case to check if input - 1 equals expected_output
4747
FOSSIL_TEST_CASE(test_input_decrement) {
48-
SampleTestData data = { .input = 5, .expected_output = 4 };
48+
CSampleTestData data = { .input = 5, .expected_output = 4 };
4949

5050
int actual_output = data.input - 1;
5151

@@ -54,7 +54,7 @@ FOSSIL_TEST_CASE(test_input_decrement) {
5454

5555
// A simple test case to check if input * 2 equals expected_output
5656
FOSSIL_TEST_CASE(test_input_double) {
57-
SampleTestData data = { .input = 5, .expected_output = 10 };
57+
CSampleTestData data = { .input = 5, .expected_output = 10 };
5858

5959
int actual_output = data.input * 2;
6060

@@ -63,7 +63,7 @@ FOSSIL_TEST_CASE(test_input_double) {
6363

6464
// A simple test case to check if input / 2 equals expected_output
6565
FOSSIL_TEST_CASE(test_input_half) {
66-
SampleTestData data = { .input = 10, .expected_output = 5 };
66+
CSampleTestData data = { .input = 10, .expected_output = 5 };
6767

6868
int actual_output = data.input / 2;
6969

code/tests/cases/test_sample.cpp

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

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

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

3737
// A simple test case to check if input + 1 equals expected_output
3838
FOSSIL_TEST_CASE(cpp_test_input_increment) {
39-
SampleTestData data = { .input = 5, .expected_output = 6 };
39+
CppSampleTestData data = { .input = 5, .expected_output = 6 };
4040

4141
int actual_output = data.input + 1;
4242

@@ -45,7 +45,7 @@ FOSSIL_TEST_CASE(cpp_test_input_increment) {
4545

4646
// A simple test case to check if input - 1 equals expected_output
4747
FOSSIL_TEST_CASE(cpp_test_input_decrement) {
48-
SampleTestData data = { .input = 5, .expected_output = 4 };
48+
CppSampleTestData data = { .input = 5, .expected_output = 4 };
4949

5050
int actual_output = data.input - 1;
5151

@@ -54,7 +54,7 @@ FOSSIL_TEST_CASE(cpp_test_input_decrement) {
5454

5555
// A simple test case to check if input * 2 equals expected_output
5656
FOSSIL_TEST_CASE(cpp_test_input_double) {
57-
SampleTestData data = { .input = 5, .expected_output = 10 };
57+
CppSampleTestData data = { .input = 5, .expected_output = 10 };
5858

5959
int actual_output = data.input * 2;
6060

@@ -63,7 +63,7 @@ FOSSIL_TEST_CASE(cpp_test_input_double) {
6363

6464
// A simple test case to check if input / 2 equals expected_output
6565
FOSSIL_TEST_CASE(cpp_test_input_half) {
66-
SampleTestData data = { .input = 10, .expected_output = 5 };
66+
CppSampleTestData data = { .input = 10, .expected_output = 5 };
6767

6868
int actual_output = data.input / 2;
6969

0 commit comments

Comments
 (0)