11
11
* Copyright (C) 2024 Fossil Logic. All rights reserved.
12
12
* -----------------------------------------------------------------------------
13
13
*/
14
- #include < fossil/test /framework.h>
14
+ #include < fossil/pizza /framework.h>
15
15
16
16
#include " fossil/crabdb/framework.h"
17
17
#include < string>
23
23
// mock objects are set here.
24
24
// * * * * * * * * * * * * * * * * * * * * * * * *
25
25
26
- FOSSIL_TEST_SUITE (cpp_myshell_fixture);
26
+ FOSSIL_SUITE (cpp_myshell_fixture);
27
27
28
28
FOSSIL_SETUP (cpp_myshell_fixture) {
29
29
// Setup the test fixture
@@ -38,7 +38,7 @@ FOSSIL_TEARDOWN(cpp_myshell_fixture) {
38
38
// * * * * * * * * * * * * * * * * * * * * * * * *
39
39
40
40
// 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) {
42
42
std::string file_name = " test.crabdb" ;
43
43
fossil_myshell_create_database (file_name.c_str ());
44
44
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) {
53
53
}
54
54
55
55
// 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) {
57
57
std::string file_name = " test.crabdb" ;
58
58
fossil_myshell_create_database (file_name.c_str ());
59
59
@@ -65,7 +65,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_read_nonexistent_record) {
65
65
}
66
66
67
67
// 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) {
69
69
std::string file_name = " test.crabdb" ;
70
70
fossil_myshell_create_database (file_name.c_str ());
71
71
@@ -76,7 +76,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_update_nonexistent_record) {
76
76
}
77
77
78
78
// 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) {
80
80
std::string file_name = " test.crabdb" ;
81
81
fossil_myshell_create_database (file_name.c_str ());
82
82
@@ -87,7 +87,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_delete_nonexistent_record) {
87
87
}
88
88
89
89
// 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) {
91
91
std::string file_name = " test.crabdb" ;
92
92
std::string backup_file = " backup.crabdb" ;
93
93
fossil_myshell_create_database (file_name.c_str ());
@@ -110,20 +110,20 @@ FOSSIL_TEST_CASE(cpp_test_myshell_backup_restore) {
110
110
}
111
111
112
112
// 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) {
114
114
ASSUME_ITS_TRUE (fossil_myshell_validate_extension (" test.crabdb" ));
115
115
ASSUME_ITS_FALSE (fossil_myshell_validate_extension (" test.txt" ));
116
116
}
117
117
118
118
// Test case for validating data
119
- FOSSIL_TEST_CASE (cpp_test_myshell_validate_data) {
119
+ FOSSIL_TEST (cpp_test_myshell_validate_data) {
120
120
ASSUME_ITS_TRUE (fossil_myshell_validate_data (" valid_data" ));
121
121
ASSUME_ITS_FALSE (fossil_myshell_validate_data (NULL ));
122
122
ASSUME_ITS_FALSE (fossil_myshell_validate_data (" " ));
123
123
}
124
124
125
125
// 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) {
127
127
std::string file_name = " test.crabdb" ;
128
128
fossil::MyShell::createDatabase (file_name);
129
129
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) {
138
138
}
139
139
140
140
// 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) {
142
142
std::string file_name = " test.crabdb" ;
143
143
fossil::MyShell::createDatabase (file_name);
144
144
@@ -150,7 +150,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_read_nonexistent_record) {
150
150
}
151
151
152
152
// 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) {
154
154
std::string file_name = " test.crabdb" ;
155
155
fossil::MyShell::createDatabase (file_name);
156
156
@@ -161,7 +161,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_update_nonexistent_record) {
161
161
}
162
162
163
163
// 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) {
165
165
std::string file_name = " test.crabdb" ;
166
166
fossil::MyShell::createDatabase (file_name);
167
167
@@ -172,7 +172,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_delete_nonexistent_record) {
172
172
}
173
173
174
174
// 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) {
176
176
std::string file_name = " test.crabdb" ;
177
177
std::string backup_file = " backup.crabdb" ;
178
178
fossil::MyShell::createDatabase (file_name);
@@ -195,7 +195,7 @@ FOSSIL_TEST_CASE(cpp_test_myshell_class_backup_restore) {
195
195
}
196
196
197
197
// 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) {
199
199
ASSUME_ITS_TRUE (fossil::MyShell::validateExtension (" test.crabdb" ));
200
200
ASSUME_ITS_FALSE (fossil::MyShell::validateExtension (" test.txt" ));
201
201
}
0 commit comments