Skip to content

Commit e7711ec

Browse files
Merge pull request #5 from dreamer-coding/main
Update Project
2 parents 714ed81 + a401956 commit e7711ec

25 files changed

+355
-218
lines changed

.github/ciimage/Dockerfile.archlinux

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ RUN pacman -Syu --noconfirm && \
1111
clang \
1212
gdb \
1313
llvm \
14-
rust \
15-
cargo \
1614
wget \
1715
python \
1816
python-pip \
1917
git \
20-
cmake \
2118
meson \
2219
ninja \
2320
tzdata && \

.github/ciimage/Dockerfile.debian

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ RUN apt-get update && \
1515
gdb \
1616
llvm \
1717
libstdc++-8-dev \
18-
cmake \
1918
wget \
2019
python3 \
2120
python3-pip \

.github/ciimage/Dockerfile.fedora

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ RUN dnf -y update && \
1313
clang \
1414
gdb \
1515
llvm \
16-
rust \
17-
cargo \
1816
wget \
1917
python3 \
2018
python3-pip \
2119
git && \
2220
dnf clean all
2321
# Install Meson and Ninja using pip
24-
RUN python3 -m pip install --no-cache-dir cmake meson ninja
22+
RUN python3 -m pip install --no-cache-dir meson ninja
2523

2624
# Set environment variables
2725
ENV CC=/usr/bin/clang

.github/ciimage/Dockerfile.ubuntu

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ RUN apt-get update && \
1515
gdb \
1616
llvm \
1717
libstdc++-10-dev \
18-
rustc \
19-
cargo \
2018
wget \
2119
python3 \
2220
python3-pip \
@@ -25,7 +23,7 @@ RUN apt-get update && \
2523
apt-get clean && \
2624
rm -rf /var/lib/apt/lists/*
2725

28-
RUN python3 -m pip install --no-cache-dir cmake meson ninja
26+
RUN python3 -m pip install --no-cache-dir meson ninja
2927

3028
# Set environment variables
3129
ENV CC=/usr/bin/gcc

.github/workflows/meson_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,4 @@ jobs:
344344
345345
- name: Build the Project
346346
run: |
347-
meson compile -C builddir
347+
meson compile -C builddir

code/logic/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dir = include_directories('.')
22

3-
fossil_sys_lib = library('fossil-sys',
3+
fossil_sys_lib = static_library('fossil-sys',
44
files('memory.c', 'datetime.c', 'hostinfo.c', 'syscall.c', 'bitwise.c'),
55
install: true,
66
dependencies: [dependency('threads')],

code/tests/cases/test_bitwise.c

Lines changed: 5 additions & 5 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/sys/framework.h"
1717

@@ -23,7 +23,7 @@
2323
// * * * * * * * * * * * * * * * * * * * * * * * *
2424

2525
// Define the test suite and add test cases
26-
FOSSIL_TEST_SUITE(c_bitwise_suite);
26+
FOSSIL_SUITE(c_bitwise_suite);
2727

2828
// Setup function for the test suite
2929
FOSSIL_SETUP(c_bitwise_suite) {
@@ -44,7 +44,7 @@ FOSSIL_TEARDOWN(c_bitwise_suite) {
4444
// * * * * * * * * * * * * * * * * * * * * * * * *
4545

4646
// ** Test fossil_sys_bitwise_parse Function **
47-
FOSSIL_TEST_CASE(c_test_bitwise_parse) {
47+
FOSSIL_TEST(c_test_bitwise_parse) {
4848
fossil_sys_bitwise_entry_t entries[] = {
4949
{"read", 0x1},
5050
{"write", 0x2},
@@ -65,7 +65,7 @@ FOSSIL_TEST_CASE(c_test_bitwise_parse) {
6565
}
6666

6767
// ** Test fossil_sys_bitwise_format Function **
68-
FOSSIL_TEST_CASE(c_test_bitwise_format) {
68+
FOSSIL_TEST(c_test_bitwise_format) {
6969
fossil_sys_bitwise_entry_t entries[] = {
7070
{"read", 0x1},
7171
{"write", 0x2},
@@ -90,7 +90,7 @@ FOSSIL_TEST_CASE(c_test_bitwise_format) {
9090
}
9191

9292
// ** Test fossil_sys_bitwise_lookup Function **
93-
FOSSIL_TEST_CASE(c_test_bitwise_lookup) {
93+
FOSSIL_TEST(c_test_bitwise_lookup) {
9494
fossil_sys_bitwise_entry_t entries[] = {
9595
{"read", 0x1},
9696
{"write", 0x2},

code/tests/cases/test_bitwise.cpp

Lines changed: 5 additions & 5 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/sys/framework.h"
1717

@@ -23,7 +23,7 @@
2323
// * * * * * * * * * * * * * * * * * * * * * * * *
2424

2525
// Define the test suite and add test cases
26-
FOSSIL_TEST_SUITE(cpp_bitwise_suite);
26+
FOSSIL_SUITE(cpp_bitwise_suite);
2727

2828
// Setup function for the test suite
2929
FOSSIL_SETUP(cpp_bitwise_suite) {
@@ -44,7 +44,7 @@ FOSSIL_TEARDOWN(cpp_bitwise_suite) {
4444
// * * * * * * * * * * * * * * * * * * * * * * * *
4545

4646
// ** Test fossil::sys::Bitwise::parse Function **
47-
FOSSIL_TEST_CASE(cpp_test_class_bitwise_parse) {
47+
FOSSIL_TEST(cpp_test_class_bitwise_parse) {
4848
fossil_sys_bitwise_entry_t entries[] = {
4949
{"read", 0x1},
5050
{"write", 0x2},
@@ -65,7 +65,7 @@ FOSSIL_TEST_CASE(cpp_test_class_bitwise_parse) {
6565
}
6666

6767
// ** Test fossil::sys::Bitwise::format Function **
68-
FOSSIL_TEST_CASE(cpp_test_class_bitwise_format) {
68+
FOSSIL_TEST(cpp_test_class_bitwise_format) {
6969
fossil_sys_bitwise_entry_t entries[] = {
7070
{"read", 0x1},
7171
{"write", 0x2},
@@ -90,7 +90,7 @@ FOSSIL_TEST_CASE(cpp_test_class_bitwise_format) {
9090
}
9191

9292
// ** Test fossil::sys::Bitwise::lookup Function **
93-
FOSSIL_TEST_CASE(cpp_test_class_bitwise_lookup) {
93+
FOSSIL_TEST(cpp_test_class_bitwise_lookup) {
9494
fossil_sys_bitwise_entry_t entries[] = {
9595
{"read", 0x1},
9696
{"write", 0x2},

code/tests/cases/test_cnullptr.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/sys/framework.h"
1717

@@ -31,7 +31,7 @@
3131
// * * * * * * * * * * * * * * * * * * * * * * * *
3232

3333
// Define the test suite and add test cases
34-
FOSSIL_TEST_SUITE(c_null_suite);
34+
FOSSIL_SUITE(c_null_suite);
3535

3636
// Setup function for the test suite
3737
FOSSIL_SETUP(c_null_suite) {
@@ -52,28 +52,28 @@ FOSSIL_TEARDOWN(c_null_suite) {
5252
// * * * * * * * * * * * * * * * * * * * * * * * *
5353

5454
// Ensure the necessary macros and types are defined
55-
FOSSIL_TEST_CASE(c_test_cnull_definition) {
55+
FOSSIL_TEST(c_test_cnull_definition) {
5656
ASSUME_ITS_EQUAL_PTR(cnull, (void *)(0));
5757
ASSUME_ITS_EQUAL_PTR(cnullptr, (void *)(0));
5858
}
5959

6060
// ** Test cnullify Macro **
61-
FOSSIL_TEST_CASE(c_test_cnullify) {
61+
FOSSIL_TEST(c_test_cnullify) {
6262
void *ptr = (void *)1;
6363
cnullify(ptr);
6464
ASSUME_ITS_EQUAL_PTR(ptr, cnull);
6565
}
6666

6767
// ** Test cnotnull Macro **
68-
FOSSIL_TEST_CASE(c_test_cnotnull) {
68+
FOSSIL_TEST(c_test_cnotnull) {
6969
void *ptr = (void *)1;
7070
ASSUME_ITS_TRUE(cnotnull(ptr));
7171
cnullify(ptr);
7272
ASSUME_ITS_FALSE(cnotnull(ptr));
7373
}
7474

7575
// ** Test cunwrap_or Macro **
76-
FOSSIL_TEST_CASE(c_test_cunwrap_or) {
76+
FOSSIL_TEST(c_test_cunwrap_or) {
7777
void *ptr = (void *)1;
7878
void *default_ptr = (void *)99;
7979
ASSUME_ITS_EQUAL_PTR(cunwrap_or(ptr, default_ptr), ptr);
@@ -82,15 +82,15 @@ FOSSIL_TEST_CASE(c_test_cunwrap_or) {
8282
}
8383

8484
// ** Test cunwrap Macro **
85-
FOSSIL_TEST_CASE(c_test_cunwrap) {
85+
FOSSIL_TEST(c_test_cunwrap) {
8686
void *ptr = (void *)1;
8787
ASSUME_ITS_EQUAL_PTR(cunwrap(ptr), ptr);
8888
// cnullify(ptr);
8989
// ASSUME_ITS_EQUAL_PTR(cunwrap(ptr), cnull); // Should exit on failure in actual code, but we test that it returns cnull
9090
}
9191

9292
// ** Test csafe_cast Macro **
93-
FOSSIL_TEST_CASE(c_test_csafe_cast) {
93+
FOSSIL_TEST(c_test_csafe_cast) {
9494
void *ptr = (void *)1;
9595
int *casted_ptr = csafe_cast(int *, ptr);
9696
ASSUME_ITS_EQUAL_PTR(casted_ptr, (int *)ptr);
@@ -100,7 +100,7 @@ FOSSIL_TEST_CASE(c_test_csafe_cast) {
100100
}
101101

102102
// ** Test cnullable and cnonnull Attributes **
103-
FOSSIL_TEST_CASE(c_test_nullable_nonnull) {
103+
FOSSIL_TEST(c_test_nullable_nonnull) {
104104
// These tests are intended to verify that nullable and nonnull attributes are handled by the compiler, so the actual test might be compiler-specific.
105105
void *ptr = cnull;
106106
ASSUME_ITS_TRUE(cnotnull(ptr) == 0);
@@ -109,15 +109,15 @@ FOSSIL_TEST_CASE(c_test_nullable_nonnull) {
109109
}
110110

111111
// ** Test coptional Macro and cnone() and csome() **
112-
FOSSIL_TEST_CASE(c_test_coptional) {
112+
FOSSIL_TEST(c_test_coptional) {
113113
void *ptr = (void *)1;
114114
ASSUME_ITS_EQUAL_PTR(c_optional(ptr), ptr);
115115
cnullify(ptr);
116116
ASSUME_ITS_EQUAL_PTR(c_optional(ptr), cnull);
117117
}
118118

119119
// ** Test COption structure and cunwrap_option Macro **
120-
FOSSIL_TEST_CASE(c_test_cunwrap_option) {
120+
FOSSIL_TEST(c_test_cunwrap_option) {
121121
COption some_option = csome((void *)1);
122122
COption none_option = cnone();
123123
ASSUME_ITS_EQUAL_PTR(cunwrap_option(some_option), (void *)1);
@@ -128,15 +128,15 @@ FOSSIL_TEST_CASE(c_test_cunwrap_option) {
128128
}
129129

130130
// ** Test cunwrap_or_option Macro **
131-
FOSSIL_TEST_CASE(c_test_cunwrap_or_option) {
131+
FOSSIL_TEST(c_test_cunwrap_or_option) {
132132
COption some_option = csome((void *)1);
133133
COption none_option = cnone();
134134
ASSUME_ITS_EQUAL_PTR(cunwrap_or_option(some_option, (void *)99), (void *)1);
135135
ASSUME_ITS_EQUAL_PTR(cunwrap_or_option(none_option, (void *)99), (void *)99);
136136
}
137137

138138
// ** Test cdrop Macro **
139-
FOSSIL_TEST_CASE(c_test_cdrop) {
139+
FOSSIL_TEST(c_test_cdrop) {
140140
void *ptr = (void *)1;
141141
cdrop(ptr);
142142
ASSUME_ITS_EQUAL_PTR(ptr, cnull);

code/tests/cases/test_cnullptr.cpp

Lines changed: 22 additions & 12 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
#include "fossil/sys/framework.h"
1616

1717
#ifndef cnull
@@ -30,7 +30,7 @@
3030
// * * * * * * * * * * * * * * * * * * * * * * * *
3131

3232
// Define the test suite and add test cases
33-
FOSSIL_TEST_SUITE(cpp_null_suite);
33+
FOSSIL_SUITE(cpp_null_suite);
3434

3535
// Setup function for the test suite
3636
FOSSIL_SETUP(cpp_null_suite) {
@@ -51,7 +51,7 @@ FOSSIL_TEARDOWN(cpp_null_suite) {
5151
// * * * * * * * * * * * * * * * * * * * * * * * *
5252

5353
// ** Test csafe_cast Macro **
54-
FOSSIL_TEST_CASE(cpp_test_csafe_cast) {
54+
FOSSIL_TEST(cpp_test_csafe_cast) {
5555
void *ptr = reinterpret_cast<void *>(1); // Use safe_cast instead of C cast
5656
int *casted_ptr = static_cast<int *>(ptr); // Using the safe_cast macro
5757
ASSUME_ITS_EQUAL_PTR(casted_ptr, reinterpret_cast<int *>(ptr));
@@ -63,22 +63,22 @@ FOSSIL_TEST_CASE(cpp_test_csafe_cast) {
6363
}
6464

6565
// ** Test cnullify Macro **
66-
FOSSIL_TEST_CASE(cpp_test_cnullify) {
66+
FOSSIL_TEST(cpp_test_cnullify) {
6767
void *ptr = reinterpret_cast<void *>(1);
6868
cnullify(ptr);
6969
ASSUME_ITS_EQUAL_PTR(ptr, cnull);
7070
}
7171

7272
// ** Test cnotnull Macro **
73-
FOSSIL_TEST_CASE(cpp_test_cnotnull) {
73+
FOSSIL_TEST(cpp_test_cnotnull) {
7474
void *ptr = reinterpret_cast<void *>(1);
7575
ASSUME_ITS_TRUE(cnotnull(ptr));
7676
cnullify(ptr);
7777
ASSUME_ITS_FALSE(cnotnull(ptr));
7878
}
7979

8080
// ** Test cunwrap_or Macro **
81-
FOSSIL_TEST_CASE(cpp_test_cunwrap_or) {
81+
FOSSIL_TEST(cpp_test_cunwrap_or) {
8282
void *ptr = reinterpret_cast<void *>(1);
8383
void *default_ptr = reinterpret_cast<void *>(99);
8484
ASSUME_ITS_EQUAL_PTR(cunwrap_or(ptr, default_ptr), ptr);
@@ -87,31 +87,31 @@ FOSSIL_TEST_CASE(cpp_test_cunwrap_or) {
8787
}
8888

8989
// ** Test cunwrap Macro **
90-
FOSSIL_TEST_CASE(cpp_test_cunwrap) {
90+
FOSSIL_TEST(cpp_test_cunwrap) {
9191
void *ptr = reinterpret_cast<void *>(1);
9292
ASSUME_ITS_EQUAL_PTR(cunwrap(ptr), ptr);
9393
// cnullify(ptr);
9494
// ASSUME_ITS_EQUAL_PTR(cunwrap(ptr), cnull); // Should return cnull when it's cnull
9595
}
9696

9797
// ** Test cnullable and cnonnull Attributes **
98-
FOSSIL_TEST_CASE(cpp_test_nullable_nonnull) {
98+
FOSSIL_TEST(cpp_test_nullable_nonnull) {
9999
void *ptr = cnull;
100100
ASSUME_ITS_TRUE(cnotnull(ptr) == 0);
101101
ptr = reinterpret_cast<void *>(1);
102102
ASSUME_ITS_TRUE(cnotnull(ptr) == 1);
103103
}
104104

105105
// ** Test coptional Macro and cnone() and csome() **
106-
FOSSIL_TEST_CASE(cpp_test_coptional) {
106+
FOSSIL_TEST(cpp_test_coptional) {
107107
void *ptr = reinterpret_cast<void *>(1);
108108
ASSUME_ITS_EQUAL_PTR(c_optional(ptr), ptr);
109109
cnullify(ptr);
110110
ASSUME_ITS_EQUAL_PTR(c_optional(ptr), cnull);
111111
}
112112

113113
// ** Test COption structure and cunwrap_option Macro **
114-
FOSSIL_TEST_CASE(cpp_test_cunwrap_option) {
114+
FOSSIL_TEST(cpp_test_cunwrap_option) {
115115
COption some_option = csome(reinterpret_cast<void *>(1));
116116
COption none_option = cnone();
117117
ASSUME_ITS_EQUAL_PTR(cunwrap_option(some_option), reinterpret_cast<void *>(1));
@@ -122,15 +122,15 @@ FOSSIL_TEST_CASE(cpp_test_cunwrap_option) {
122122
}
123123

124124
// ** Test cunwrap_or_option Macro **
125-
FOSSIL_TEST_CASE(cpp_test_cunwrap_or_option) {
125+
FOSSIL_TEST(cpp_test_cunwrap_or_option) {
126126
COption some_option = csome(reinterpret_cast<void *>(1));
127127
COption none_option = cnone();
128128
ASSUME_ITS_EQUAL_PTR(cunwrap_or_option(some_option, reinterpret_cast<void *>(99)), reinterpret_cast<void *>(1));
129129
ASSUME_ITS_EQUAL_PTR(cunwrap_or_option(none_option, reinterpret_cast<void *>(99)), reinterpret_cast<void *>(99));
130130
}
131131

132132
// ** Test cdrop Macro **
133-
FOSSIL_TEST_CASE(cpp_test_cdrop) {
133+
FOSSIL_TEST(cpp_test_cdrop) {
134134
void *ptr = reinterpret_cast<void *>(1);
135135
cdrop(ptr);
136136
ASSUME_ITS_EQUAL_PTR(ptr, cnull);
@@ -142,6 +142,16 @@ FOSSIL_TEST_CASE(cpp_test_cdrop) {
142142

143143
FOSSIL_TEST_GROUP(cpp_nullptr_tests) {
144144
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_csafe_cast);
145+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cnullify);
146+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cnotnull);
147+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cunwrap_or);
148+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cunwrap);
149+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_nullable_nonnull);
150+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_coptional);
151+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cunwrap_option);
152+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cunwrap_or_option);
153+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cdrop);
154+
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cnotnull);
145155
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_nullable_nonnull);
146156
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_coptional);
147157
FOSSIL_TEST_ADD(cpp_null_suite, cpp_test_cunwrap_option);

0 commit comments

Comments
 (0)