Просмотр исходного кода

Organize mocks

Put mocks to directory structure mimicking project structure.
master
TheoryOfNekomata 1 год назад
Родитель
Сommit
5ce887f3db
24 измененных файлов: 134 добавлений и 66 удалений
  1. +1
    -1
      .gitignore
  2. +37
    -16
      CMakeLists.txt
  3. +1
    -0
      TODO.md
  4. +0
    -0
      __mocks__/dependencies/SDL2/SDL_events.mock.h
  5. +2
    -2
      __mocks__/dependencies/SDL2/SDL_joystick.mock.h
  6. +2
    -2
      __mocks__/dependencies/SDL2/SDL_keyboard.mock.h
  7. +2
    -2
      __mocks__/dependencies/SDL2/SDL_render.mock.h
  8. +6
    -2
      __mocks__/dependencies/SDL2/SDL_stdinc.mock.h
  9. +2
    -2
      __mocks__/dependencies/minIni/minIni.mock.h
  10. +1
    -1
      __mocks__/dependencies/portmidi/portmidi.mock.h
  11. +11
    -0
      __mocks__/src/packages/log/IZ_log.mock.h
  12. +19
    -0
      __mocks__/src/packages/stdinc/IZ_stdlib.mock.h
  13. +10
    -0
      __mocks__/src/packages/stdinc/IZ_string.mock.h
  14. +3
    -3
      src/packages/config/IZ_config.c
  15. +4
    -4
      src/packages/game/IZ_app.c
  16. +1
    -1
      src/packages/game/data/data.test.c
  17. +3
    -3
      src/packages/game/input/IZ_input.c
  18. +5
    -5
      src/packages/game/input/input.test.c
  19. +2
    -2
      src/packages/game/memory/IZ_pool.c
  20. +11
    -9
      src/packages/game/memory/memory.test.c
  21. +3
    -3
      src/packages/game/output/output.test.c
  22. +3
    -3
      src/packages/game/output/video/IZ_video.c
  23. +4
    -4
      src/packages/log/IZ_intercept.c
  24. +1
    -1
      src/packages/net/IZ_net_client.c

+ 1
- 1
.gitignore Просмотреть файл

@@ -59,7 +59,7 @@ $RECYCLE.BIN/
*.lnk
.idea/
cmake-build-debug/
dependencies/
/dependencies/
assets_wip/
Backup_*.cdr
.DS_Store

+ 37
- 16
CMakeLists.txt Просмотреть файл

@@ -130,8 +130,8 @@ add_executable(
src/packages/game/data/IZ_list.h
src/packages/net/svc/IZ_wsclient.c
src/packages/net/svc/IZ_wsclient.h
src/packages/log/IZ_intercept.c
src/packages/log/IZ_intercept.h
src/packages/log/IZ_intercept.c
src/packages/log/IZ_intercept.h
src/packages/midi/IZ_midi.c
src/packages/midi/IZ_midi.h
src/packages/net/core/IZ_websocket.h
@@ -149,11 +149,18 @@ add_executable(
src/packages/game/IZ_app_config.h
src/packages/game/asset/IZ_asset.c
src/packages/game/asset/IZ_asset.h
src/packages/stdinc/IZ_string.c
src/packages/stdinc/IZ_string.h
src/packages/stdinc/IZ_string.c
src/packages/stdinc/IZ_string.h
src/packages/io/IZ_io.c
src/packages/io/IZ_io.h
src/packages/log/IZ_log.c src/packages/log/IZ_log.h src/packages/timer/IZ_timer.c src/packages/timer/IZ_timer.h src/packages/compat/IZ_windows.h src/packages/stdinc/IZ_stdlib.c src/packages/stdinc/IZ_stdlib.h)
src/packages/log/IZ_log.c
src/packages/log/IZ_log.h
src/packages/timer/IZ_timer.c
src/packages/timer/IZ_timer.h
src/packages/compat/IZ_windows.h
src/packages/stdinc/IZ_stdlib.c
src/packages/stdinc/IZ_stdlib.h
)

if (WIN32)
target_link_libraries(
@@ -200,12 +207,12 @@ add_executable(
src/packages/test/IZ_mock.h
src/packages/test/IZ_test.h

__mocks__/minIni.mock.h
__mocks__/SDL_keyboard.mock.h
__mocks__/SDL_events.mock.h
__mocks__/SDL_joystick.mock.h
__mocks__/SDL_stdinc.mock.h
__mocks__/portmidi.mock.h
__mocks__/dependencies/minIni/minIni.mock.h
__mocks__/dependencies/SDL2/SDL_keyboard.mock.h
__mocks__/dependencies/SDL2/SDL_events.mock.h
__mocks__/dependencies/SDL2/SDL_joystick.mock.h
__mocks__/dependencies/SDL2/SDL_stdinc.mock.h
__mocks__/dependencies/portmidi/portmidi.mock.h

src/packages/config/IZ_config.h

@@ -229,9 +236,9 @@ add_executable(
dependencies/bdd-for-c/bdd-for-c.h
src/packages/test/IZ_mock.h
src/packages/test/IZ_test.h
__mocks__/minIni.mock.h
__mocks__/SDL_stdinc.mock.h
__mocks__/SDL_render.mock.h
__mocks__/dependencies/minIni/minIni.mock.h
__mocks__/dependencies/SDL2/SDL_stdinc.mock.h
__mocks__/dependencies/SDL2/SDL_render.mock.h
src/packages/config/IZ_config.h
src/packages/game/output/video/IZ_video.h
src/packages/game/output/video/IZ_video.c
@@ -243,6 +250,14 @@ add_executable(
dependencies/bdd-for-c/bdd-for-c.h
src/packages/test/IZ_mock.h
src/packages/test/IZ_test.h
src/packages/timer/IZ_timer.h
src/packages/timer/IZ_timer.c
src/packages/stdinc/IZ_stdlib.h
__mocks__/src/packages/stdinc/IZ_stdlib.mock.h
src/packages/stdinc/IZ_string.h
__mocks__/src/packages/stdinc/IZ_string.mock.h
src/packages/log/IZ_log.h
__mocks__/src/packages/log/IZ_log.mock.h
src/packages/game/memory/IZ_pool.h
src/packages/game/memory/IZ_pool.c
src/packages/game/memory/memory.test.c
@@ -250,6 +265,12 @@ add_executable(
src/packages/game/data/IZ_list.h
)

target_link_libraries(
game-test-memory
SDL2main
SDL2
)

add_executable(
game-test-data
dependencies/bdd-for-c/bdd-for-c.h
@@ -284,8 +305,8 @@ add_executable(
src/packages/server/db/IZ_repo.c
src/packages/server/db/IZ_repo.h
src/packages/server/IZ_subsystem.h
src/packages/stdinc/IZ_string.c
src/packages/stdinc/IZ_string.h
src/packages/stdinc/IZ_string.c
src/packages/stdinc/IZ_string.h
src/packages/io/IZ_io.c
src/packages/io/IZ_io.h
src/packages/log/IZ_log.c


+ 1
- 0
TODO.md Просмотреть файл

@@ -1,5 +1,6 @@
- [X] Improve logging (remove SDL/lws dependency)
- [X] Unify memset/memcpy/free/malloc functions (remove SDL/lws dependency)
- [ ] Implement memory pool
- [ ] Fix gamepad mapping
- [ ] Provide default mapping
- [ ] Allow customization of button mappings


__mocks__/SDL_events.mock.h → __mocks__/dependencies/SDL2/SDL_events.mock.h Просмотреть файл


__mocks__/SDL_joystick.mock.h → __mocks__/dependencies/SDL2/SDL_joystick.mock.h Просмотреть файл

@@ -1,8 +1,8 @@
#ifndef SDL_JOYSTICK_MOCK_H
#define SDL_JOYSTICK_MOCK_H

#include "../src/packages/common/IZ_common.h"
#include "../src/packages/test/IZ_test.h"
#include "../../../src/packages/common/IZ_common.h"
#include "../../../src/packages/test/IZ_test.h"

typedef struct _SDL_Joystick {} SDL_Joystick;


__mocks__/SDL_keyboard.mock.h → __mocks__/dependencies/SDL2/SDL_keyboard.mock.h Просмотреть файл

@@ -1,8 +1,8 @@
#ifndef SDL_KEYBOARD_MOCK_H
#define SDL_KEYBOARD_MOCK_H

#include "../src/packages/common/IZ_common.h"
#include "../src/packages/test/IZ_test.h"
#include "../../../src/packages/common/IZ_common.h"
#include "../../../src/packages/test/IZ_test.h"

mock(SDL_GetKeyName) const char* SDL_GetKeyName(i32 key) {
mock_return(SDL_GetKeyName) "";

__mocks__/SDL_render.mock.h → __mocks__/dependencies/SDL2/SDL_render.mock.h Просмотреть файл

@@ -1,8 +1,8 @@
#ifndef SDL_RENDER_MOCK_H
#define SDL_RENDER_MOCK_H

#include "../src/packages/common/IZ_common.h"
#include "../src/packages/test/IZ_test.h"
#include "../../../src/packages/common/IZ_common.h"
#include "../../../src/packages/test/IZ_test.h"

typedef struct SDL_Renderer SDL_Renderer;


__mocks__/SDL_stdinc.mock.h → __mocks__/dependencies/SDL2/SDL_stdinc.mock.h Просмотреть файл

@@ -2,8 +2,8 @@
#define SDL_STDINC_MOCK_H

#include <string.h>
#include "../src/packages/common/IZ_common.h"
#include "../src/packages/test/IZ_test.h"
#include "../../../src/packages/common/IZ_common.h"
#include "../../../src/packages/test/IZ_test.h"

mock(SDL_memcpy) void* SDL_memcpy(void* dst, const void* src, size_t len) {
mock_return(SDL_memcpy) memcpy(dst, src, len);
@@ -21,4 +21,8 @@ mock(SDL_free) void SDL_free(void* mem) {
mock_return(SDL_free);
}

mock(SDL_calloc) void* SDL_calloc(size_t num, size_t size) {
mock_return(SDL_calloc) calloc(num, size);
}

#endif

__mocks__/minIni.mock.h → __mocks__/dependencies/minIni/minIni.mock.h Просмотреть файл

@@ -1,8 +1,8 @@
#ifndef MININI_MOCK_H
#define MININI_MOCK_H

#include "../src/packages/common/IZ_common.h"
#include "../src/packages/test/IZ_test.h"
#include "../../../src/packages/common/IZ_common.h"
#include "../../../src/packages/test/IZ_test.h"

mock(ini_getl) long ini_getl(const char *Section, const char *Key, long DefValue, const char *Filename) {
mock_return(ini_getl) DefValue;

__mocks__/portmidi.mock.h → __mocks__/dependencies/portmidi/portmidi.mock.h Просмотреть файл

@@ -3,7 +3,7 @@

#define PORTMIDI_INCLUDED

#include "../src/packages/common/IZ_common.h"
#include "../../../src/packages/common/IZ_common.h"

typedef i32 PmDeviceID;
typedef void PortMidiStream;

+ 11
- 0
__mocks__/src/packages/log/IZ_log.mock.h Просмотреть файл

@@ -0,0 +1,11 @@
#ifndef IZ_LOG_MOCK_H
#define IZ_LOG_MOCK_H

#include "../../../src/packages/log/IZ_log.h"
#include "../../../src/packages/test/IZ_mock.h"

mock(IZ_LogInfo) void IZ_LogInfo(IZ_LogCategory category, const char* format, ...) {
mock_return(IZ_LogInfo);
}

#endif

+ 19
- 0
__mocks__/src/packages/stdinc/IZ_stdlib.mock.h Просмотреть файл

@@ -0,0 +1,19 @@
#ifndef IZ_STDLIB_MOCK_C
#define IZ_STDLIB_MOCK_C

#include <SDL_stdinc.h>
#include "../../../../src/packages/test/IZ_mock.h"

mock(IZ_malloc) void* IZ_malloc(size_t size) {
mock_return(IZ_malloc) SDL_malloc(size);
}

mock(IZ_free) void IZ_free(void* mem) {
mock_return(IZ_free) SDL_free(mem);
}

mock(IZ_calloc) void* IZ_calloc(unsigned int num, size_t size) {
mock_return(IZ_calloc) SDL_calloc(num, size);
}

#endif

+ 10
- 0
__mocks__/src/packages/stdinc/IZ_string.mock.h Просмотреть файл

@@ -0,0 +1,10 @@
#ifndef IZ_STRING_MOCK_C
#define IZ_STRING_MOCK_C

#include "../../../../src/packages/test/IZ_mock.h"

mock(IZ_memset) void* IZ_memset(void* dst, int c, size_t len) {
mock_return(IZ_memset) 0;
}

#endif

+ 3
- 3
src/packages/config/IZ_config.c Просмотреть файл

@@ -346,14 +346,14 @@ IZ_ConfigInitializeResult IZ_ConfigInitialize(IZ_ConfigItem item[], const char*
IZ_ConfigLoad(item, config_path);
IZ_ConfigSaveResult save_result = IZ_ConfigSave(item, config_path);
if (save_result < 0) {
IZ_LogError("Config sync failed! Result: %u", save_result);
IZ_LogError("app/config Sync failed! Result: %u", save_result);
return IZ_CONFIG_INITIALIZE_RESULT_ERROR;
}
IZ_ConfigOverride(item, argc, argv);
if (save_result > 0) {
IZ_LogWarn(false, "Config sync encountered issues. Result: %u", save_result);
IZ_LogWarn(false, "app/config Sync encountered issues. Result: %u", save_result);
return IZ_CONFIG_INITIALIZE_RESULT_WARNING;
}
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Config sync successful.");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/config Sync successful.");
return IZ_CONFIG_INITIALIZE_RESULT_OK;
}

+ 4
- 4
src/packages/game/IZ_app.c Просмотреть файл

@@ -28,7 +28,7 @@ typedef enum {
IZ_AppInitializeResult IZ_AppInitialize(struct IZ_App* app, u8 argc, const char* argv[]) {
IZ_LogInterceptWSMessages(LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE);

IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Starting %s...", IZ_APP_NAME);
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/global Starting %s...", IZ_APP_NAME);
IZ_memset(app, 0, sizeof(struct IZ_App));

const char* cmdline_buffer;
@@ -47,7 +47,7 @@ IZ_AppInitializeResult IZ_AppInitialize(struct IZ_App* app, u8 argc, const char*
);

if (SDL_Init(flags) < 0) {
IZ_LogError("Framework initialization failed! Reason: %s", SDL_GetError());
IZ_LogError("app/global Framework initialization failed! Reason: %s", SDL_GetError());
return IZ_APP_INITIALIZE_RESULT_SDL_ERROR;
}

@@ -70,12 +70,12 @@ IZ_AppInitializeResult IZ_AppInitialize(struct IZ_App* app, u8 argc, const char*
}

void IZ_AppTeardown(struct IZ_App* app) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Shutting down networking...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/net Shutting down...");
IZ_NetClientDisconnect(&app->net_state);
IZ_PoolTeardown(&app->pool);
IZ_InputTeardown(&app->input_state);
IZ_VideoTeardown(&app->video_state);
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Stopping %s...", IZ_APP_NAME);
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/global Stopping %s...", IZ_APP_NAME);
SDL_Quit();
}



+ 1
- 1
src/packages/game/data/data.test.c Просмотреть файл

@@ -1,6 +1,6 @@
#include "../../test/IZ_test.h"
#include "../../common/IZ_common.h"
#include "../../../__mocks__/SDL_stdinc.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_stdinc.mock.h"
#include "IZ_list.h"

bool NodeExists(IZ_ListNode** node, u64 _index, IZ_List* list) {


+ 3
- 3
src/packages/game/input/IZ_input.c Просмотреть файл

@@ -10,7 +10,7 @@ void IZ_InputHandlePortMIDIEvents(IZ_InputState* state, PmEvent e) {
}

IZ_ProcedureResult IZ_InputInitialize(IZ_InputState* state, const char* config_path, u8 argc, const char* argv[]) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Setting up input...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/input Setting up...");

*state = (IZ_InputState) {
.action = {},
@@ -40,13 +40,13 @@ IZ_ProcedureResult IZ_InputInitialize(IZ_InputState* state, const char* config_p

IZ_ProcedureResult final_result = -result;

IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Input setup complete. Result: %d", final_result);
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/input Setup complete. Result: %d", final_result);

return final_result;
}

void IZ_InputTeardown(IZ_InputState* state) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Shutting down input...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/input Shutting down...");
IZ_JoystickTeardown(&state->joystick_state);
IZ_MIDIInputTeardown(&state->midi_input_state);
}

+ 5
- 5
src/packages/game/input/input.test.c Просмотреть файл

@@ -1,8 +1,8 @@
#include "../../../__mocks__/SDL_keyboard.mock.h"
#include "../../../__mocks__/SDL_joystick.mock.h"
#include "../../../__mocks__/SDL_stdinc.mock.h"
#include "../../../__mocks__/minIni.mock.h"
#include "../../../__mocks__/portmidi.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_keyboard.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_joystick.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_stdinc.mock.h"
#include "../../../../__mocks__/dependencies/minIni/minIni.mock.h"
#include "../../../../__mocks__/dependencies/portmidi/portmidi.mock.h"
//#include "../../stdinc/IZ_string.h"
#include "IZ_keyboard.h"
#include "IZ_joystick.h"


+ 2
- 2
src/packages/game/memory/IZ_pool.c Просмотреть файл

@@ -1,7 +1,7 @@
#include "IZ_pool.h"

void IZ_PoolInitialize(IZ_Pool* pool, size_t size) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Setting up memory pools...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/memory Setting up pool...");
IZ_ListInitialize(&pool->items);
pool->memory = IZ_malloc(size);
IZ_memset(pool->memory, 0, size);
@@ -47,7 +47,7 @@ void IZ_PoolDeallocate(IZ_PoolItem* item) {
}

void IZ_PoolTeardown(IZ_Pool* pool) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Shutting down memory pools...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/memory Shutting down pool...");
IZ_free(pool->memory);
pool->memory = NULL;
}

+ 11
- 9
src/packages/game/memory/memory.test.c Просмотреть файл

@@ -1,5 +1,7 @@
#include "../../test/IZ_test.h"
#include "../../../__mocks__/SDL_stdinc.mock.h"
#include <bdd-for-c.h>
#include "../../../../__mocks__/src/packages/log/IZ_log.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_stdlib.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_string.mock.h"
#include "IZ_pool.h"

struct DummyInnerStruct {
@@ -21,11 +23,11 @@ spec("memory") {
static IZ_Pool pool;

after_each() {
mock_reset(SDL_memset);
mock_reset(IZ_memset);
}

after_each() {
mock_reset(SDL_malloc);
mock_reset(IZ_malloc);
}

after_each() {
@@ -33,12 +35,12 @@ spec("memory") {
}

it("initializes the pool values") {
mock_set_expected_calls(SDL_memset, 1);
mock_set_expected_calls(IZ_memset, 1);

IZ_PoolInitialize(&pool, POOL_MAX_SIZE);

check(
mock_get_expected_calls(SDL_memset) == mock_get_actual_calls(SDL_memset),
mock_get_expected_calls(IZ_memset) == mock_get_actual_calls(IZ_memset),
"Call count mismatch."
);
}
@@ -47,7 +49,7 @@ spec("memory") {
IZ_PoolInitialize(&pool, POOL_MAX_SIZE);

check(
mock_is_called(SDL_malloc),
mock_is_called(IZ_malloc),
"Memory not allocated."
);
}
@@ -172,14 +174,14 @@ spec("memory") {
}

after_each() {
mock_reset(SDL_free);
mock_reset(IZ_free);
}

it("frees memory") {
IZ_PoolTeardown(&pool);

check(
mock_is_called(SDL_free),
mock_is_called(IZ_free),
"Memory not freed."
);
}


+ 3
- 3
src/packages/game/output/output.test.c Просмотреть файл

@@ -1,6 +1,6 @@
#include "../../../__mocks__/minIni.mock.h"
#include "../../../__mocks__/SDL_stdinc.mock.h"
#include "../../../__mocks__/SDL_render.mock.h"
#include "../../../../__mocks__/dependencies/minIni/minIni.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_stdinc.mock.h"
#include "../../../../__mocks__/dependencies/SDL2/SDL_render.mock.h"
#include "video/IZ_video.h"

const char* IZ_ConfigGetCommandlineOption(u8 argc, const char* argv[], const char* val) {


+ 3
- 3
src/packages/game/output/video/IZ_video.c Просмотреть файл

@@ -65,7 +65,7 @@ IZ_ProcedureResult IZ_VideoInitializeConfig(IZ_VideoState* state, const char* c
}

IZ_ProcedureResult IZ_VideoInitialize(IZ_VideoState* state, void* user_data, const char* config_path, u8 argc, const char* argv[]) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Setting up video...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/video Setting up...");
IZ_memcpy(state, sizeof(IZ_VideoState), &IZ_VIDEO_DEFAULT_STATE, sizeof(IZ_VideoState));
IZ_memset(state->active_sprites, 0, sizeof(IZ_SpriteSlot) * IZ_MAX_ACTIVE_SPRITES);
if (IZ_VideoInitializeConfig(state, config_path, argc, argv) < 0) {
@@ -84,7 +84,7 @@ IZ_ProcedureResult IZ_VideoInitialize(IZ_VideoState* state, void* user_data, con
SDL_WINDOW_SHOWN
);
if (window == NULL) {
IZ_LogError("Window could not be created! Reason: %s", SDL_GetError());
IZ_LogError("app/video Window could not be created! Reason: %s", SDL_GetError());
return -3;
}
state->window = window;
@@ -93,7 +93,7 @@ IZ_ProcedureResult IZ_VideoInitialize(IZ_VideoState* state, void* user_data, con
}

void IZ_VideoTeardown(IZ_VideoState* state) {
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Shutting down video...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/video Shutting down...");
for (u16 i = 0; i < IZ_MAX_ACTIVE_SPRITES; i += 1) {
if (state->active_sprites[i].sprite.texture) {
SDL_DestroyTexture(state->active_sprites[i].sprite.texture);


+ 4
- 4
src/packages/log/IZ_intercept.c Просмотреть файл

@@ -56,20 +56,20 @@ void IZ_LogInterceptHandleFromWS(i32 level, const char* line) {
switch (level) {
// TODO level is a bit field...check if each level is OR'd.
case LLL_ERR:
IZ_LogError("ws %s", buffer);
IZ_LogError("app/net/ws %s", buffer);
return;
case LLL_WARN:
IZ_LogWarn(false, "ws %s", buffer);
IZ_LogWarn(false, "app/net/ws %s", buffer);
return;
case LLL_NOTICE:
IZ_LogInfo(IZ_LOG_CATEGORY_GENERIC, "ws %s", buffer);
IZ_LogInfo(IZ_LOG_CATEGORY_GENERIC, "app/net/ws %s", buffer);
return;
case LLL_USER:
default:
break;
}

IZ_Log("ws %s", buffer);
IZ_Log("app/net/ws %s", buffer);
}

void IZ_LogInterceptWSMessages(i32 level) {


+ 1
- 1
src/packages/net/IZ_net_client.c Просмотреть файл

@@ -106,7 +106,7 @@ IZ_ProcedureResult IZ_NetClientInitialize(
if (!user_data) {
return -1;
}
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "Setting up networking...");
IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "app/net Setting up...");
IZ_memcpy(state, sizeof(IZ_NetClientState), &IZ_NET_CLIENT_DEFAULT_STATE, sizeof(IZ_NetClientState));
if (IZ_NetClientInitializeConfig(state, config_path, argc, argv) < 0) {
return -2;


Загрузка…
Отмена
Сохранить