{"id":31927033,"url":"https://github.com/throwtheswitch/unity","last_synced_at":"2025-10-14T01:56:33.217Z","repository":{"id":2316638,"uuid":"3276860","full_name":"ThrowTheSwitch/Unity","owner":"ThrowTheSwitch","description":"Simple unit testing for C","archived":false,"fork":false,"pushed_at":"2025-09-29T20:16:46.000Z","size":7254,"stargazers_count":4792,"open_issues_count":96,"forks_count":1062,"subscribers_count":164,"default_branch":"master","last_synced_at":"2025-10-03T06:37:22.615Z","etag":null,"topics":["c","unit-testing"],"latest_commit_sha":null,"homepage":"https://ThrowTheSwitch.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThrowTheSwitch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":"ThrowTheSwitch"}},"created_at":"2012-01-26T19:52:36.000Z","updated_at":"2025-10-02T13:04:48.000Z","dependencies_parsed_at":"2024-01-19T17:45:33.396Z","dependency_job_id":"8c21197d-31aa-4233-8231-382af7a672a6","html_url":"https://github.com/ThrowTheSwitch/Unity","commit_stats":{"total_commits":935,"total_committers":165,"mean_commits":5.666666666666667,"dds":0.7903743315508022,"last_synced_commit":"b175905940e24192aaf57ca2dae9a32cd24f99d8"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ThrowTheSwitch/Unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThrowTheSwitch%2FUnity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThrowTheSwitch%2FUnity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThrowTheSwitch%2FUnity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThrowTheSwitch%2FUnity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThrowTheSwitch","download_url":"https://codeload.github.com/ThrowTheSwitch/Unity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThrowTheSwitch%2FUnity/sbom","scorecard":{"id":141291,"data":{"date":"2025-08-11","repo":{"name":"github.com/ThrowTheSwitch/Unity","commit":"0d7ea70b557f9e2fa558eb31398fd6bdfd6aa77c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Maintained","score":10,"reason":"27 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":9,"reason":"Found 10/11 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/ThrowTheSwitch/Unity/main.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T08:12:51.148Z","repository_id":2316638,"created_at":"2025-08-16T08:12:51.148Z","updated_at":"2025-08-16T08:12:51.148Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017468,"owners_count":26086090,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","unit-testing"],"created_at":"2025-10-14T01:56:08.675Z","updated_at":"2025-10-14T01:56:33.210Z","avatar_url":"https://github.com/ThrowTheSwitch.png","language":"C","readme":"# Unity Test ![CI][]\n\n__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__\n\nWelcome to the Unity Test Project, one of the main projects of ThrowTheSwitch.org.\nUnity Test is a unit testing framework built for C, with a focus on working with embedded toolchains.\n\nThis project is made to test code targetting microcontrollers big and small.\nThe core project is a single C file and a pair of headers, allowing it to be added to your existing build setup without too much headache.\nYou may use any compiler you wish, and may use most existing build systems including Make, CMake, etc.\nIf you'd like to leave the hard work to us, you might be interested in Ceedling, a build tool also by ThrowTheSwitch.org.\n\nIf you're new to Unity, we encourage you to tour the [getting started guide][].\n\nYou can also find the [change log][] and [known issues][] in our documentation.\n\n## Getting Started\n\nThe [docs][] folder contains a [getting started guide][] and much more tips about using Unity.\n\n## Unity Assertion Summary\n\nFor the full list, see [UnityAssertionsReference.md][].\n\n### Basic Validity Tests\n\n    TEST_ASSERT_TRUE(condition)\n\nEvaluates whatever code is in condition and fails if it evaluates to false\n\n    TEST_ASSERT_FALSE(condition)\n\nEvaluates whatever code is in condition and fails if it evaluates to true\n\n    TEST_ASSERT(condition)\n\nAnother way of calling `TEST_ASSERT_TRUE`\n\n    TEST_ASSERT_UNLESS(condition)\n\nAnother way of calling `TEST_ASSERT_FALSE`\n\n    TEST_FAIL()\n    TEST_FAIL_MESSAGE(message)\n\nThis test is automatically marked as a failure.\nThe message is output stating why.\n\n### Numerical Assertions: Integers\n\n    TEST_ASSERT_EQUAL_INT(expected, actual)\n    TEST_ASSERT_EQUAL_INT8(expected, actual)\n    TEST_ASSERT_EQUAL_INT16(expected, actual)\n    TEST_ASSERT_EQUAL_INT32(expected, actual)\n    TEST_ASSERT_EQUAL_INT64(expected, actual)\n\nCompare two integers for equality and display errors as signed integers.\nA cast will be performed to your natural integer size so often this can just be used.\nWhen you need to specify the exact size, you can use a specific version.\n\n    TEST_ASSERT_EQUAL_UINT(expected, actual)\n    TEST_ASSERT_EQUAL_UINT8(expected, actual)\n    TEST_ASSERT_EQUAL_UINT16(expected, actual)\n    TEST_ASSERT_EQUAL_UINT32(expected, actual)\n    TEST_ASSERT_EQUAL_UINT64(expected, actual)\n\nCompare two integers for equality and display errors as unsigned integers.\nLike INT, there are variants for different sizes also.\n\n    TEST_ASSERT_EQUAL_HEX(expected, actual)\n    TEST_ASSERT_EQUAL_HEX8(expected, actual)\n    TEST_ASSERT_EQUAL_HEX16(expected, actual)\n    TEST_ASSERT_EQUAL_HEX32(expected, actual)\n    TEST_ASSERT_EQUAL_HEX64(expected, actual)\n\nCompares two integers for equality and display errors as hexadecimal.\nLike the other integer comparisons, you can specify the size... \nhere the size will also affect how many nibbles are shown (for example, `HEX16` will show 4 nibbles).\n\n    TEST_ASSERT_EQUAL(expected, actual)\n\nAnother way of calling TEST_ASSERT_EQUAL_INT\n\n    TEST_ASSERT_INT_WITHIN(delta, expected, actual)\n\nAsserts that the actual value is within plus or minus delta of the expected value.\nThis also comes in size specific variants.\n\n    TEST_ASSERT_GREATER_THAN(threshold, actual)\n\nAsserts that the actual value is greater than the threshold.\nThis also comes in size specific variants.\n\n    TEST_ASSERT_LESS_THAN(threshold, actual)\n\nAsserts that the actual value is less than the threshold.\nThis also comes in size specific variants.\n\n### Arrays\n\n    _ARRAY\n\nYou can append `_ARRAY` to any of these macros to make an array comparison of that type.\nHere you will need to care a bit more about the actual size of the value being checked.\nYou will also specify an additional argument which is the number of elements to compare.\nFor example:\n\n    TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements)\n\n    _EACH_EQUAL\n\nAnother array comparison option is to check that EVERY element of an array is equal to a single expected value.\nYou do this by specifying the EACH_EQUAL macro.\nFor example:\n\n    TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements)\n\n### Numerical Assertions: Bitwise\n\n    TEST_ASSERT_BITS(mask, expected, actual)\n\nUse an integer mask to specify which bits should be compared between two other integers.\nHigh bits in the mask are compared, low bits ignored.\n\n    TEST_ASSERT_BITS_HIGH(mask, actual)\n\nUse an integer mask to specify which bits should be inspected to determine if they are all set high.\nHigh bits in the mask are compared, low bits ignored.\n\n    TEST_ASSERT_BITS_LOW(mask, actual)\n\nUse an integer mask to specify which bits should be inspected to determine if they are all set low.\nHigh bits in the mask are compared, low bits ignored.\n\n    TEST_ASSERT_BIT_HIGH(bit, actual)\n\nTest a single bit and verify that it is high.\nThe bit is specified 0-31 for a 32-bit integer.\n\n    TEST_ASSERT_BIT_LOW(bit, actual)\n\nTest a single bit and verify that it is low.\nThe bit is specified 0-31 for a 32-bit integer.\n\n### Numerical Assertions: Floats\n\n    TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual)\n    TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual)\n\nAsserts that the actual value is within plus or minus delta of the expected value.\n\n    TEST_ASSERT_FLOAT_NOT_WITHIN(delta, expected, actual)\n    TEST_ASSERT_DOUBLE_NOT_WITHIN(delta, expected, actual)\n\nAsserts that the actual value is NOT within plus or minus delta of the expected value.\n\n    TEST_ASSERT_EQUAL_FLOAT(expected, actual)\n    TEST_ASSERT_EQUAL_DOUBLE(expected, actual)\n\nAsserts that two floating point values are \"equal\" within a small % delta of the expected value.\n\n    TEST_ASSERT_NOT_EQUAL_FLOAT(expected, actual)\n    TEST_ASSERT_NOT_EQUAL_DOUBLE(expected, actual)\n\nAsserts that two floating point values are NOT \"equal\" within a small % delta of the expected value.\n\n    TEST_ASSERT_LESS_THAN_FLOAT(threshold, actual)\n    TEST_ASSERT_LESS_THAN_DOUBLE(threshold, actual)\n    TEST_ASSERT_GREATER_THAN_FLOAT(threshold, actual)\n    TEST_ASSERT_GREATER_THAN_DOUBLE(threshold, actual)\n\nAsserts that the actual value is less than or greater than the threshold.\n\nThere are also `LESS_OR_EQUAL` and `GREATER_OR_EQUAL` variations.\nThese obey the same rules for equality as do `TEST_ASSERT_EQUAL_FLOAT` and `TEST_ASSERT_EQUAL_DOUBLE`:\nIf the two values are within a small % delta of the expected value, the assertion will pass.\n\n### String Assertions\n\n    TEST_ASSERT_EQUAL_STRING(expected, actual)\n\nCompare two null-terminate strings.\nFail if any character is different or if the lengths are different.\n\n    TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len)\n\nCompare two strings.\nFail if any character is different, stop comparing after len characters.\n\n    TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message)\n\nCompare two null-terminate strings.\nFail if any character is different or if the lengths are different.\nOutput a custom message on failure.\n\n    TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message)\n\nCompare two strings.\nFail if any character is different, stop comparing after len characters.\nOutput a custom message on failure.\n\n### Pointer Assertions\n\nMost pointer operations can be performed by simply using the integer comparisons above.\nHowever, a couple of special cases are added for clarity.\n\n    TEST_ASSERT_NULL(pointer)\n\nFails if the pointer is not equal to NULL\n\n    TEST_ASSERT_NOT_NULL(pointer)\n\nFails if the pointer is equal to NULL\n\n### Memory Assertions\n\n    TEST_ASSERT_EQUAL_MEMORY(expected, actual, len)\n\nCompare two blocks of memory.\nThis is a good generic assertion for types that can't be coerced into acting like standard types... \nbut since it's a memory compare, you have to be careful that your data types are packed.\n\n### \\_MESSAGE\n\nYou can append `\\_MESSAGE` to any of the macros to make them take an additional argument.\nThis argument is a string that will be printed at the end of the failure strings.\nThis is useful for specifying more information about the problem.\n\n[CI]: https://github.com/ThrowTheSwitch/Unity/workflows/CI/badge.svg\n[getting started guide]: docs/UnityGettingStartedGuide.md\n[change log]: docs/UnityChangeLog.md\n[known issues]: docs/UnityKnownIssues.md\n[docs]: docs/\n[UnityAssertionsReference.md]: docs/UnityAssertionsReference.md\n","funding_links":["https://github.com/sponsors/ThrowTheSwitch"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthrowtheswitch%2Funity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthrowtheswitch%2Funity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthrowtheswitch%2Funity/lists"}