diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-06-18 00:08:54 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-06-25 00:15:17 +0200 |
| commit | 0f5581f53f73a92d33826c4771553a9683376e67 (patch) | |
| tree | eab8172d21dc4a0b36714af541d22a82cec858f3 /core | |
| parent | 00a0cb3821ce2bd0fc589ae64ed9cbb791ce44bb (diff) | |
Adds unit testing scaffold and build tests
Diffstat (limited to 'core')
| -rw-r--r-- | core/client.cpp | 8 | ||||
| -rw-r--r-- | core/logger.c | 1 | ||||
| -rw-r--r-- | core/salis.c | 19 |
3 files changed, 15 insertions, 13 deletions
diff --git a/core/client.cpp b/core/client.cpp index d541129..750f2be 100644 --- a/core/client.cpp +++ b/core/client.cpp @@ -22,7 +22,6 @@ // [section] includes // ---------------------------------------------------------------------------- #include <arpa/inet.h> -#include <GL/glu.h> #include <GLFW/glfw3.h> #include <imgui_impl_glfw.h> #include <imgui_impl_opengl3.h> @@ -348,8 +347,6 @@ std::array g_hm_colormap = std::to_array<ImVec4>({ {0.988f, 1.000f, 0.643f, 1.f}, }); -PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData; - // ---------------------------------------------------------------------------- // [section] string comparator definition // ---------------------------------------------------------------------------- @@ -747,7 +744,7 @@ void PlotHeatmap::render_internal(const ImVec2 &frame_size) { assert(new_tex_id); if (m_tex_id) { - glCopyImageSubData( + ((PFNGLCOPYIMAGESUBDATAPROC)glfwGetProcAddress("glCopyImageSubData"))( m_tex_id, GL_TEXTURE_2D, 0, 0, rows_to_chop_off, 0, new_tex_id, GL_TEXTURE_2D, 0, 0, 0, 0, g_hm_pixel_count, m_rows_rendered - rows_to_chop_off, 1 @@ -1464,9 +1461,6 @@ void init() { glfwSwapInterval(0); #endif - glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glfwGetProcAddress("glCopyImageSubData"); - assert(glCopyImageSubData); - log_info("Initializing ImGui"); IMGUI_CHECKVERSION(); ImGui::CreateContext(); diff --git a/core/logger.c b/core/logger.c index 2c8746f..af41dcc 100644 --- a/core/logger.c +++ b/core/logger.c @@ -79,6 +79,7 @@ void log_msg(enum LogLevel level, bool colored, const char *format, va_list args char buff[LOG_LINE_SIZE]; log_msg_to_buff(buff, LOG_LINE_SIZE, level, colored, format, args); printf("\r%s\n", buff); + fflush(stdout); } void log_info_default(const char *format, ...) { diff --git a/core/salis.c b/core/salis.c index 9f9a3d0..dac9e52 100644 --- a/core/salis.c +++ b/core/salis.c @@ -310,6 +310,7 @@ uint64_t mvec_get_owner(const struct Core *core, uint64_t addr) { // ---------------------------------------------------------------------------- // [section] mutator functions // ---------------------------------------------------------------------------- +#if SEED != 0 #if defined(COMMAND_NEW) uint64_t muta_smix(uint64_t *seed) { assert(seed); @@ -357,6 +358,7 @@ void muta_cosmic_ray(struct Core *core) { #endif } } +#endif // ---------------------------------------------------------------------------- // [section] process functions @@ -491,12 +493,15 @@ void core_init(struct Core *core, uint64_t *seed) { assert(core); assert(seed); - if (*seed) { - core->muta[0] = muta_smix(seed); - core->muta[1] = muta_smix(seed); - core->muta[2] = muta_smix(seed); - core->muta[3] = muta_smix(seed); - } +#if SEED != 0 + assert(*seed); + core->muta[0] = muta_smix(seed); + core->muta[1] = muta_smix(seed); + core->muta[2] = muta_smix(seed); + core->muta[3] = muta_smix(seed); +#else + (void)seed; +#endif core->pnum = CLONES; core->pcap = CLONES; @@ -642,7 +647,9 @@ void core_step(struct Core *core) { proc_kill(core); } +#if SEED != 0 muta_cosmic_ray(core); +#endif core_step(core); } |
