Skip to content

Commit dd96fec

Browse files
update test files
1 parent 3f0eb6b commit dd96fec

File tree

4 files changed

+60
-60
lines changed

4 files changed

+60
-60
lines changed

code/tests/cases/test_myshell.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (C) 2024 Fossil Logic. All rights reserved.
1212
* -----------------------------------------------------------------------------
1313
*/
14-
#include <fossil/test/framework.h>
14+
#include <fossil/pizza/framework.h>
1515

1616
#include "fossil/crabdb/framework.h"
1717

@@ -22,7 +22,7 @@
2222
// mock objects are set here.
2323
// * * * * * * * * * * * * * * * * * * * * * * * *
2424

25-
FOSSIL_TEST_SUITE(c_myshell_fixture);
25+
FOSSIL_SUITE(c_myshell_fixture);
2626

2727
FOSSIL_SETUP(c_myshell_fixture) {
2828
// Setup the test fixture
@@ -37,7 +37,7 @@ FOSSIL_TEARDOWN(c_myshell_fixture) {
3737
// * * * * * * * * * * * * * * * * * * * * * * * *
3838

3939
// Test case for creating a new record in the database file
40-
FOSSIL_TEST_CASE(c_test_myshell_create_record) {
40+
FOSSIL_TEST(c_test_myshell_create_record) {
4141
const char *file_name = "test.crabdb";
4242
fossil_myshell_create_database(file_name);
4343
fossil_myshell_error_t result = fossil_myshell_create_record(file_name, "key1", "value1");
@@ -52,7 +52,7 @@ FOSSIL_TEST_CASE(c_test_myshell_create_record) {
5252
}
5353

5454
// Test case for reading a non-existent record from the database file
55-
FOSSIL_TEST_CASE(c_test_myshell_read_nonexistent_record) {
55+
FOSSIL_TEST(c_test_myshell_read_nonexistent_record) {
5656
const char *file_name = "test.crabdb";
5757
fossil_myshell_create_database(file_name);
5858

@@ -64,7 +64,7 @@ FOSSIL_TEST_CASE(c_test_myshell_read_nonexistent_record) {
6464
}
6565

6666
// Test case for updating a non-existent record in the database file
67-
FOSSIL_TEST_CASE(c_test_myshell_update_nonexistent_record) {
67+
FOSSIL_TEST(c_test_myshell_update_nonexistent_record) {
6868
const char *file_name = "test.crabdb";
6969
fossil_myshell_create_database(file_name);
7070

@@ -75,7 +75,7 @@ FOSSIL_TEST_CASE(c_test_myshell_update_nonexistent_record) {
7575
}
7676

7777
// Test case for deleting a non-existent record from the database file
78-
FOSSIL_TEST_CASE(c_test_myshell_delete_nonexistent_record) {
78+
FOSSIL_TEST(c_test_myshell_delete_nonexistent_record) {
7979
const char *file_name = "test.crabdb";
8080
fossil_myshell_create_database(file_name);
8181

@@ -86,7 +86,7 @@ FOSSIL_TEST_CASE(c_test_myshell_delete_nonexistent_record) {
8686
}
8787

8888
// Test case for backing up and restoring a database file
89-
FOSSIL_TEST_CASE(c_test_myshell_backup_restore) {
89+
FOSSIL_TEST(c_test_myshell_backup_restore) {
9090
const char *file_name = "test.crabdb";
9191
const char *backup_file = "backup.crabdb";
9292
fossil_myshell_create_database(file_name);
@@ -109,13 +109,13 @@ FOSSIL_TEST_CASE(c_test_myshell_backup_restore) {
109109
}
110110

111111
// Test case for validating the file extension of a database file
112-
FOSSIL_TEST_CASE(c_test_myshell_validate_extension) {
112+
FOSSIL_TEST(c_test_myshell_validate_extension) {
113113
ASSUME_ITS_TRUE(fossil_myshell_validate_extension("test.crabdb"));
114114
ASSUME_ITS_FALSE(fossil_myshell_validate_extension("test.txt"));
115115
}
116116

117117
// Test case for validating data
118-
FOSSIL_TEST_CASE(c_test_myshell_validate_data) {
118+
FOSSIL_TEST(c_test_myshell_validate_data) {
119119
ASSUME_ITS_TRUE(fossil_myshell_validate_data("valid_data"));
120120
ASSUME_ITS_FALSE(fossil_myshell_validate_data(NULL));
121121
ASSUME_ITS_FALSE(fossil_myshell_validate_data(""));

code/tests/cases/test_myshell.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (C) 2024 Fossil Logic. All rights reserved.
1212
* -----------------------------------------------------------------------------
1313
*/
14-
#include <fossil/test/framework.h>
14+
#include <fossil/pizza/framework.h>
1515

1616
#include "fossil/crabdb/framework.h"
1717
#include <string>
@@ -23,7 +23,7 @@
2323
// mock objects are set here.
2424
// * * * * * * * * * * * * * * * * * * * * * * * *
2525

26-
FOSSIL_TEST_SUITE(cpp_myshell_fixture);
26+
FOSSIL_SUITE(cpp_myshell_fixture);
2727

2828
FOSSIL_SETUP(cpp_myshell_fixture) {
2929
// Setup the test fixture
@@ -38,7 +38,7 @@ FOSSIL_TEARDOWN(cpp_myshell_fixture) {
3838
// * * * * * * * * * * * * * * * * * * * * * * * *
3939

4040
// Test case for creating a new record in the database file
41-
FOSSIL_TEST_CASE(cpp_test_myshell_create_record) {
41+
FOSSIL_TEST(cpp_test_myshell_create_record) {
4242
std::string file_name = "test.crabdb";
4343
fossil_myshell_create_database(file_name.c_str());
4444
fossil_myshell_error_t result = fossil_myshell_create_record(file_name.c_str(), "key1", "value1");
@@ -53,7 +53,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_create_record) {
5353
}
5454

5555
// Test case for reading a non-existent record from the database file
56-
FOSSIL_TEST_CASE(cpp_test_myshell_read_nonexistent_record) {
56+
FOSSIL_TEST(cpp_test_myshell_read_nonexistent_record) {
5757
std::string file_name = "test.crabdb";
5858
fossil_myshell_create_database(file_name.c_str());
5959

@@ -65,7 +65,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_read_nonexistent_record) {
6565
}
6666

6767
// Test case for updating a non-existent record in the database file
68-
FOSSIL_TEST_CASE(cpp_test_myshell_update_nonexistent_record) {
68+
FOSSIL_TEST(cpp_test_myshell_update_nonexistent_record) {
6969
std::string file_name = "test.crabdb";
7070
fossil_myshell_create_database(file_name.c_str());
7171

@@ -76,7 +76,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_update_nonexistent_record) {
7676
}
7777

7878
// Test case for deleting a non-existent record from the database file
79-
FOSSIL_TEST_CASE(cpp_test_myshell_delete_nonexistent_record) {
79+
FOSSIL_TEST(cpp_test_myshell_delete_nonexistent_record) {
8080
std::string file_name = "test.crabdb";
8181
fossil_myshell_create_database(file_name.c_str());
8282

@@ -87,7 +87,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_delete_nonexistent_record) {
8787
}
8888

8989
// Test case for backing up and restoring a database file
90-
FOSSIL_TEST_CASE(cpp_test_myshell_backup_restore) {
90+
FOSSIL_TEST(cpp_test_myshell_backup_restore) {
9191
std::string file_name = "test.crabdb";
9292
std::string backup_file = "backup.crabdb";
9393
fossil_myshell_create_database(file_name.c_str());
@@ -110,20 +110,20 @@ FOSSIL_TEST_CASE(cpp_test_myshell_backup_restore) {
110110
}
111111

112112
// Test case for validating the file extension of a database file
113-
FOSSIL_TEST_CASE(cpp_test_myshell_validate_extension) {
113+
FOSSIL_TEST(cpp_test_myshell_validate_extension) {
114114
ASSUME_ITS_TRUE(fossil_myshell_validate_extension("test.crabdb"));
115115
ASSUME_ITS_FALSE(fossil_myshell_validate_extension("test.txt"));
116116
}
117117

118118
// Test case for validating data
119-
FOSSIL_TEST_CASE(cpp_test_myshell_validate_data) {
119+
FOSSIL_TEST(cpp_test_myshell_validate_data) {
120120
ASSUME_ITS_TRUE(fossil_myshell_validate_data("valid_data"));
121121
ASSUME_ITS_FALSE(fossil_myshell_validate_data(NULL));
122122
ASSUME_ITS_FALSE(fossil_myshell_validate_data(""));
123123
}
124124

125125
// Test case for creating a new record using MyShell class
126-
FOSSIL_TEST_CASE(cpp_test_myshell_class_create_record) {
126+
FOSSIL_TEST(cpp_test_myshell_class_create_record) {
127127
std::string file_name = "test.crabdb";
128128
fossil::MyShell::createDatabase(file_name);
129129
fossil_myshell_error_t result = fossil::MyShell::createRecord(file_name, "key1", "value1");
@@ -138,7 +138,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_create_record) {
138138
}
139139

140140
// Test case for reading a non-existent record using MyShell class
141-
FOSSIL_TEST_CASE(cpp_test_myshell_class_read_nonexistent_record) {
141+
FOSSIL_TEST(cpp_test_myshell_class_read_nonexistent_record) {
142142
std::string file_name = "test.crabdb";
143143
fossil::MyShell::createDatabase(file_name);
144144

@@ -150,7 +150,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_read_nonexistent_record) {
150150
}
151151

152152
// Test case for updating a non-existent record using MyShell class
153-
FOSSIL_TEST_CASE(cpp_test_myshell_class_update_nonexistent_record) {
153+
FOSSIL_TEST(cpp_test_myshell_class_update_nonexistent_record) {
154154
std::string file_name = "test.crabdb";
155155
fossil::MyShell::createDatabase(file_name);
156156

@@ -161,7 +161,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_update_nonexistent_record) {
161161
}
162162

163163
// Test case for deleting a non-existent record using MyShell class
164-
FOSSIL_TEST_CASE(cpp_test_myshell_class_delete_nonexistent_record) {
164+
FOSSIL_TEST(cpp_test_myshell_class_delete_nonexistent_record) {
165165
std::string file_name = "test.crabdb";
166166
fossil::MyShell::createDatabase(file_name);
167167

@@ -172,7 +172,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_delete_nonexistent_record) {
172172
}
173173

174174
// Test case for backing up and restoring a database using MyShell class
175-
FOSSIL_TEST_CASE(cpp_test_myshell_class_backup_restore) {
175+
FOSSIL_TEST(cpp_test_myshell_class_backup_restore) {
176176
std::string file_name = "test.crabdb";
177177
std::string backup_file = "backup.crabdb";
178178
fossil::MyShell::createDatabase(file_name);
@@ -195,7 +195,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_backup_restore) {
195195
}
196196

197197
// Test case for validating the file extension using MyShell class
198-
FOSSIL_TEST_CASE(cpp_test_myshell_class_validate_extension) {
198+
FOSSIL_TEST(cpp_test_myshell_class_validate_extension) {
199199
ASSUME_ITS_TRUE(fossil::MyShell::validateExtension("test.crabdb"));
200200
ASSUME_ITS_FALSE(fossil::MyShell::validateExtension("test.txt"));
201201
}

code/tests/cases/test_noshell.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (C) 2024 Fossil Logic. All rights reserved.
1212
* -----------------------------------------------------------------------------
1313
*/
14-
#include <fossil/test/framework.h>
14+
#include <fossil/pizza/framework.h>
1515

1616
#include "fossil/crabdb/framework.h"
1717

@@ -22,7 +22,7 @@
2222
// mock objects are set here.
2323
// * * * * * * * * * * * * * * * * * * * * * * * *
2424

25-
FOSSIL_TEST_SUITE(c_noshell_fixture);
25+
FOSSIL_SUITE(c_noshell_fixture);
2626

2727
FOSSIL_SETUP(c_noshell_fixture) {
2828
// Setup the test fixture
@@ -37,14 +37,14 @@ FOSSIL_TEARDOWN(c_noshell_fixture) {
3737
// * * * * * * * * * * * * * * * * * * * * * * * *
3838

3939
// Test case for creating a new database
40-
FOSSIL_TEST_CASE(c_test_noshell_create_database) {
40+
FOSSIL_TEST(c_test_noshell_create_database) {
4141
fossil_noshell_error_t result = fossil_noshell_create_database("test.crabdb");
4242
ASSUME_ITS_TRUE(result == FOSSIL_NOSHELL_ERROR_SUCCESS);
4343
remove("test.crabdb");
4444
}
4545

4646
// Test case for opening an existing database
47-
FOSSIL_TEST_CASE(c_test_noshell_open_database) {
47+
FOSSIL_TEST(c_test_noshell_open_database) {
4848
FILE *file = fopen("test.crabdb", "w");
4949
fclose(file);
5050
fossil_noshell_error_t result = fossil_noshell_open_database("test.crabdb");
@@ -53,15 +53,15 @@ FOSSIL_TEST_CASE(c_test_noshell_open_database) {
5353
}
5454

5555
// Test case for deleting a database
56-
FOSSIL_TEST_CASE(c_test_noshell_delete_database) {
56+
FOSSIL_TEST(c_test_noshell_delete_database) {
5757
FILE *file = fopen("test.crabdb", "w");
5858
fclose(file);
5959
fossil_noshell_error_t result = fossil_noshell_delete_database("test.crabdb");
6060
ASSUME_ITS_TRUE(result == FOSSIL_NOSHELL_ERROR_SUCCESS);
6161
}
6262

6363
// Test case for inserting a document into the database
64-
FOSSIL_TEST_CASE(c_test_noshell_insert_document) {
64+
FOSSIL_TEST(c_test_noshell_insert_document) {
6565
FILE *file = fopen("test.crabdb", "w");
6666
fclose(file);
6767
fossil_noshell_error_t result = fossil_noshell_insert("test.crabdb", "document1");
@@ -70,7 +70,7 @@ FOSSIL_TEST_CASE(c_test_noshell_insert_document) {
7070
}
7171

7272
// Test case for finding a document in the database
73-
FOSSIL_TEST_CASE(c_test_noshell_find_document) {
73+
FOSSIL_TEST(c_test_noshell_find_document) {
7474
FILE *file = fopen("test.crabdb", "w");
7575
fprintf(file, "document1\n");
7676
fclose(file);
@@ -82,7 +82,7 @@ FOSSIL_TEST_CASE(c_test_noshell_find_document) {
8282
}
8383

8484
// Test case for updating a document in the database
85-
FOSSIL_TEST_CASE(c_test_noshell_update_document) {
85+
FOSSIL_TEST(c_test_noshell_update_document) {
8686
FILE *file = fopen("test.crabdb", "w");
8787
fprintf(file, "document1\n");
8888
fclose(file);
@@ -95,7 +95,7 @@ FOSSIL_TEST_CASE(c_test_noshell_update_document) {
9595
}
9696

9797
// Test case for removing a document from the database
98-
FOSSIL_TEST_CASE(c_test_noshell_remove_document) {
98+
FOSSIL_TEST(c_test_noshell_remove_document) {
9999
FILE *file = fopen("test.crabdb", "w");
100100
fprintf(file, "document1\n");
101101
fclose(file);
@@ -108,7 +108,7 @@ FOSSIL_TEST_CASE(c_test_noshell_remove_document) {
108108
}
109109

110110
// Test case for backing up a database
111-
FOSSIL_TEST_CASE(c_test_noshell_backup_database) {
111+
FOSSIL_TEST(c_test_noshell_backup_database) {
112112
FILE *file = fopen("test.crabdb", "w");
113113
fprintf(file, "document1\n");
114114
fclose(file);
@@ -125,7 +125,7 @@ FOSSIL_TEST_CASE(c_test_noshell_backup_database) {
125125
}
126126

127127
// Test case for restoring a database from a backup
128-
FOSSIL_TEST_CASE(c_test_noshell_restore_database) {
128+
FOSSIL_TEST(c_test_noshell_restore_database) {
129129
FILE *backup = fopen("backup.crabdb", "w");
130130
fprintf(backup, "document1\n");
131131
fclose(backup);
@@ -142,15 +142,15 @@ FOSSIL_TEST_CASE(c_test_noshell_restore_database) {
142142
}
143143

144144
// Test case for validating the file extension
145-
FOSSIL_TEST_CASE(c_test_noshell_validate_extension) {
145+
FOSSIL_TEST(c_test_noshell_validate_extension) {
146146
bool result = fossil_noshell_validate_extension("test.crabdb");
147147
ASSUME_ITS_TRUE(result);
148148
result = fossil_noshell_validate_extension("test.txt");
149149
ASSUME_ITS_FALSE(result);
150150
}
151151

152152
// Test case for validating a document
153-
FOSSIL_TEST_CASE(c_test_noshell_validate_document) {
153+
FOSSIL_TEST(c_test_noshell_validate_document) {
154154
bool result = fossil_noshell_validate_document("document1");
155155
ASSUME_ITS_TRUE(result);
156156
result = fossil_noshell_validate_document("");

0 commit comments

Comments
 (0)