{"id":16161475,"url":"https://github.com/gamemann/glib-tests","last_synced_at":"2025-03-18T22:30:44.384Z","repository":{"id":92735650,"uuid":"437346804","full_name":"gamemann/GLib-Tests","owner":"gamemann","description":"A repository I'm using to learn hashing with GLib.","archived":false,"fork":false,"pushed_at":"2022-12-09T12:15:34.000Z","size":5,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T23:51:21.461Z","etag":null,"topics":["c","fast","ghash","glib","glib2-0","hash","pkg-config","structs","structures"],"latest_commit_sha":null,"homepage":"https://moddingcommunity.com/forums/topic/76-tests-using-glib","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/gamemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-12-11T17:30:55.000Z","updated_at":"2025-02-16T12:56:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"37e8de77-798b-4d49-8eea-81c88f018399","html_url":"https://github.com/gamemann/GLib-Tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FGLib-Tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FGLib-Tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FGLib-Tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2FGLib-Tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamemann","download_url":"https://codeload.github.com/gamemann/GLib-Tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244318332,"owners_count":20433879,"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":["c","fast","ghash","glib","glib2-0","hash","pkg-config","structs","structures"],"created_at":"2024-10-10T02:25:21.602Z","updated_at":"2025-03-18T22:30:44.376Z","avatar_url":"https://github.com/gamemann.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GLib Tests\n## Description\nA repository I'm using to store my progress while learning GNOME's GLib [library](https://github.com/GNOME/glib). Specifically hashing via `ghash`.\n\n## Test Files\n### GLib Structures (glib_structs.c)\nIn this test, we have structures as keys and values (all integers). However, the total size for each the key and value exceeds 64-bits. We also use the `g_int_hash` hashing function (along with `g_int_equal`) which works fine.\n\nBy default, the amount of entries it inserts and looks up is 5 (`MAX_ENTRIES_DEFAULT`). However, the first argument of the program determines how many entries to insert and lookup.\n\nPlease look at the following example.\n\n```bash\n./build/glib_structs 20\n```\n\nThe above (after building, of course) will output the following.\n\n```bash\ndev@test02:~/glib-tests$ ./build/glib_structs 20\nSuccessfully inserted entry! Key =\u003e 0:0:0:0 (0). Val =\u003e 0:0:0:0:0:0.\nSuccessfully inserted entry! Key =\u003e 300:3:600:90 (1). Val =\u003e 1:2:3:4:100000:10000000.\nSuccessfully inserted entry! Key =\u003e 600:6:1200:180 (2). Val =\u003e 2:4:6:8:200000:20000000.\nSuccessfully inserted entry! Key =\u003e 900:9:1800:270 (3). Val =\u003e 3:6:9:12:300000:30000000.\nSuccessfully inserted entry! Key =\u003e 1200:12:2400:360 (4). Val =\u003e 4:8:12:16:400000:40000000.\nSuccessfully inserted entry! Key =\u003e 1500:15:3000:450 (5). Val =\u003e 5:10:15:20:500000:50000000.\nSuccessfully inserted entry! Key =\u003e 1800:18:3600:540 (6). Val =\u003e 6:12:18:24:600000:60000000.\nSuccessfully inserted entry! Key =\u003e 2100:21:4200:630 (7). Val =\u003e 7:14:21:28:700000:70000000.\nSuccessfully inserted entry! Key =\u003e 2400:24:4800:720 (8). Val =\u003e 8:16:24:32:800000:80000000.\nSuccessfully inserted entry! Key =\u003e 2700:27:5400:810 (9). Val =\u003e 9:18:27:36:900000:90000000.\nSuccessfully inserted entry! Key =\u003e 3000:30:6000:900 (10). Val =\u003e 10:20:30:40:1000000:100000000.\nSuccessfully inserted entry! Key =\u003e 3300:33:6600:990 (11). Val =\u003e 11:22:33:44:1100000:110000000.\nSuccessfully inserted entry! Key =\u003e 3600:36:7200:1080 (12). Val =\u003e 12:24:36:48:1200000:120000000.\nSuccessfully inserted entry! Key =\u003e 3900:39:7800:1170 (13). Val =\u003e 13:26:39:52:1300000:130000000.\nSuccessfully inserted entry! Key =\u003e 4200:42:8400:1260 (14). Val =\u003e 14:28:42:56:1400000:140000000.\nSuccessfully inserted entry! Key =\u003e 4500:45:9000:1350 (15). Val =\u003e 15:30:45:60:1500000:150000000.\nSuccessfully inserted entry! Key =\u003e 4800:48:9600:1440 (16). Val =\u003e 16:32:48:64:1600000:160000000.\nSuccessfully inserted entry! Key =\u003e 5100:51:10200:1530 (17). Val =\u003e 17:34:51:68:1700000:170000000.\nSuccessfully inserted entry! Key =\u003e 5400:54:10800:1620 (18). Val =\u003e 18:36:54:72:1800000:180000000.\nSuccessfully inserted entry! Key =\u003e 5700:57:11400:1710 (19). Val =\u003e 19:38:57:76:1900000:190000000.\nSize of table is now 20 (entries).\nLookup successful! Key =\u003e 0:0:0:0 (0). Val =\u003e 0:0:0:0:0:0.\nLookup successful! Key =\u003e 300:3:600:90 (1). Val =\u003e 1:2:3:4:100000:10000000.\nLookup successful! Key =\u003e 600:6:1200:180 (2). Val =\u003e 2:4:6:8:200000:20000000.\nLookup successful! Key =\u003e 900:9:1800:270 (3). Val =\u003e 3:6:9:12:300000:30000000.\nLookup successful! Key =\u003e 1200:12:2400:360 (4). Val =\u003e 4:8:12:16:400000:40000000.\nLookup successful! Key =\u003e 1500:15:3000:450 (5). Val =\u003e 5:10:15:20:500000:50000000.\nLookup successful! Key =\u003e 1800:18:3600:540 (6). Val =\u003e 6:12:18:24:600000:60000000.\nLookup successful! Key =\u003e 2100:21:4200:630 (7). Val =\u003e 7:14:21:28:700000:70000000.\nLookup successful! Key =\u003e 2400:24:4800:720 (8). Val =\u003e 8:16:24:32:800000:80000000.\nLookup successful! Key =\u003e 2700:27:5400:810 (9). Val =\u003e 9:18:27:36:900000:90000000.\nLookup successful! Key =\u003e 3000:30:6000:900 (10). Val =\u003e 10:20:30:40:1000000:100000000.\nLookup successful! Key =\u003e 3300:33:6600:990 (11). Val =\u003e 11:22:33:44:1100000:110000000.\nLookup successful! Key =\u003e 3600:36:7200:1080 (12). Val =\u003e 12:24:36:48:1200000:120000000.\nLookup successful! Key =\u003e 3900:39:7800:1170 (13). Val =\u003e 13:26:39:52:1300000:130000000.\nLookup successful! Key =\u003e 4200:42:8400:1260 (14). Val =\u003e 14:28:42:56:1400000:140000000.\nLookup successful! Key =\u003e 4500:45:9000:1350 (15). Val =\u003e 15:30:45:60:1500000:150000000.\nLookup successful! Key =\u003e 4800:48:9600:1440 (16). Val =\u003e 16:32:48:64:1600000:160000000.\nLookup successful! Key =\u003e 5100:51:10200:1530 (17). Val =\u003e 17:34:51:68:1700000:170000000.\nLookup successful! Key =\u003e 5400:54:10800:1620 (18). Val =\u003e 18:36:54:72:1800000:180000000.\nLookup successful! Key =\u003e 5700:57:11400:1710 (19). Val =\u003e 19:38:57:76:1900000:190000000.\n```\n\n## Building\nYou may use `git` and `make` to build this project. You will also need `clang` and `libglib2.0`.\n\nThe following will do for Debian/Ubuntu systems.\n\n```bash\n# Run apt update as root.\nsudo apt update\n\n# Install Make and build essentials.\nsudo apt install build-essential\n\n# Install Clang if it isn't installed already.\nsudo apt install clang\n\n# Install GLib 2.0 along with pkg-config (which is used for obtaining GLib's include paths and linker libraries).\nsudo apt install libglib2.0 pkg-config\n\n# Clone the repository.\ngit clone https://github.com/gamemann/GLib-Tests.git\n\n# Change directory to GLib-Tests/.\ncd GLib-Tests/\n\n# Run Make which will output executables into the build/ directory.\nmake\n```\n\n## Credits\n* [Christian Deacon](https://github.com/gamemann)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fglib-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamemann%2Fglib-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fglib-tests/lists"}