{"id":16186922,"url":"https://github.com/robloach/raylib-assert","last_synced_at":"2025-03-19T03:30:35.204Z","repository":{"id":66036478,"uuid":"446652387","full_name":"RobLoach/raylib-assert","owner":"RobLoach","description":"Minimalistic assertion library for unit testing raylib.","archived":false,"fork":false,"pushed_at":"2024-01-10T19:55:03.000Z","size":158,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-20T06:31:33.585Z","etag":null,"topics":["raylib"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-11T02:33:36.000Z","updated_at":"2024-07-26T17:11:49.023Z","dependencies_parsed_at":"2024-07-26T17:11:45.765Z","dependency_job_id":"3da228f3-4c89-4ee0-aa82-d0ecc9753549","html_url":"https://github.com/RobLoach/raylib-assert","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/raylib-assert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243963581,"owners_count":20375644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["raylib"],"created_at":"2024-10-10T07:19:50.633Z","updated_at":"2025-03-19T03:30:34.856Z","avatar_url":"https://github.com/RobLoach.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raylib-assert\n\nMinimalistic [assertion](https://en.wikipedia.org/wiki/Assertion_(software_development)) library for [raylib](https://www.raylib.com).\n\n## Example\n\n``` c\n#include \"raylib.h\"\n#include \"raylib-assert.h\"\n\nint main(void)\n{\n    Assert(10 == 10);\n    // =\u003e Reports nothing, since the assert passes.\n\n    Assert(IsWindowReady());\n    // =\u003e ASSERT: IsWindowReady() (main.c:22)\n\n    Assert(IsWindowReady(), \"Window has not been created\");\n    // =\u003e ASSERT: Window has not been created (main.c:25)\n\n    int x = 10;\n    int y = 20;\n    AssertEqual(x, y, \"%i and %i aren't the same!\", x, y);\n    // =\u003e ASSERT: 10 and 20 aren't the same! (main.c:30)\n\n    AssertFail(\"DESTROY ALL HUMANS!\");\n    // =\u003e ASSERT: DESTROY ALL HUMANS! (main.c: 35)\n\n    Image image = LoadImage(\"NotFound.png\");\n    AssertImage(image);\n    // =\u003e ASSERT: Image not loaded (image)  (main.c: 40)\n}\n```\n\n## API\n\n``` c\nAssert(condition, [message], [params]);      // Asserts whether the given condition is true, with the given message parameters.\nAssertNot(condition, [message], [params]);   // Asserts whether the given condition is false.\nAssertEqual(expected, actual, [message], [params]); // Asserts that the expected parameter is the same as the actual parameter.\nAssertNotEqual(unexpected, actual, [message], [params]); // Asserts that the expected parameter is not the same as the actual parameter.\nAssertFail([message], [params]);             // Sets a failed assertion, with the given message.\nAssertImage(image, [message], [params]);     // Asserts whether the given image has been loaded properly.\nAssertTexture(texture, [message], [params]); // Asserts whether the given texture has been loaded properly.\nAssertColorSame(color1, color2, [message], [params]); // Asserts whether the given colors are the same.\nAssertImageSame(image1, image2, [message], [params]); // Asserts whether the given images are the same.\nAssertVector2Same(vector1, vector2, [message], [params]); // Asserts whether the given vector2s are the same.\n```\n\n## Options\n\nYou are able to change the behavior of assertions by making some defines prior to including `raylib-assert.h`:\n``` c\n// #define RAYLIB_ASSERT_LOG LOG_FATAL\n// #define RAYLIB_ASSERT_NDEBUG\n// #define RAYLIB_ASSERT_TRACELOG TraceLog\n// #define RAYLIB_ASSERT_TEXTFORMAT TextFormat\n#include \"raylib-assert.h\"\n```\n\n### `RAYLIB_ASSERT_LOG`\n\nThe trace log level to use when reporting to TraceLog() on failed assertions. By default, will report to `LOG_FATAL`. This will result in a forceful exit of the program, and fail the application. To have failed assertions simply report a warning with `LOG_WARNING` instead, you can use...\n\n``` c\n#define RAYLIB_ASSERT_LOG LOG_WARNING\n```\n\n### `RAYLIB_ASSERT_NDEBUG`\n\nAssertions can be completely ignored by defining `RAYLIB_ASSERT_NDEBUG` prior to including the file. This is enabled automatically if [`NDEBUG`](https://www.oreilly.com/library/view/c-in-a/059600298X/re171.html) is in use.\n\n``` c\n#define RAYLIB_ASSERT_NDEBUG\n```\n\n### `RAYLIB_ASSERT_TRACELOG`\n\nAllows changing which `TraceLog()` function the assertion library uses to output messages.\n\n``` c\n#define RAYLIB_ASSERT_TRACELOG TraceLog\n```\n\n### `RAYLIB_ASSERT_TEXTFORMAT`\n\nAllows changing which `TextFormat()` function the assertion library uses to output messages.\n\n``` c\n#define RAYLIB_ASSERT_TEXTFORMAT TextFormat\n```\n\n## License\n\nraylib-assert is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Fraylib-assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-assert/lists"}