aboutsummaryrefslogtreecommitdiff
path: root/src/tests-lib.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-09-01CHANGELOG.md: Point to english version URLEuAndreh1-1/+1
2021-09-01.gitignore: Add translation filesEuAndreh1-2/+4
2021-09-01Remove tests/install-uninstall.sh in favor of repocheck.shEuAndreh2-50/+0
2021-09-01mv doc/po/ po/...EuAndreh6-0/+1856
2021-09-01mv aux/workflow/manpages.sh doc/manpages.shEuAndreh1-0/+0
2021-09-01aux/: UpdateEuAndreh17-87/+153
2021-09-01src/remembering.c: Enforce C styleEuAndreh1-10/+20
2021-09-01Refactor C files, split logerr and tests-libEuAndreh10-17/+318
2021-09-01tests/lib.sh: UpdateEuAndreh3-4/+25
2021-09-01mv src/remembering-c.c src/remembering.cEuAndreh3-8/+11
2021-09-01Makefile: s/run-tests/remembering-tests/EuAndreh2-4/+4
2021-09-01Makefile: Revamp "clean" targetEuAndreh1-3/+7
2021-09-01Makefile: Refactor personal workflow targets to include new translations flowEuAndreh1-7/+21
2021-09-01Makefile: Add repocheck.sh to "dev-check" target, separate it from the ↵EuAndreh1-7/+15
canonical path
2021-09-01Makefile: Use quotes around macro namesEuAndreh1-11/+11
2021-09-01Makefile: Use chmod when generating src/remembering instead of afterwardsEuAndreh1-1/+1
Now running "make" for the second time will say everything is up-to-date, instead of always changing the permission again and again.
2021-09-01src/remembering.in: Add empty line on help textEuAndreh1-0/+1
2021-09-01aux/workflow/favicon.png: RemoveEuAndreh1-0/+0
2021-08-20TODOs.md: Add #task-a5c8dd18-b180-2731-601a-e26f137a2740EuAndreh1-0/+3
2021-07-23git grep -lF tar.gz | xargs sed -i 's/tar\.gz/tar.xz/g'EuAndreh1-7/+7
2021-07-23aux/: UpdateEuAndreh18-208/+260
2021-06-28TODOs.md: Mark #task-bd165b74-c559-48ee-1d29-eaa906aa0393 as DONEEuAndreh1-1/+5
2021-06-28src/remembering-c.c: Free leaking "home" string variableEuAndreh1-0/+1
2021-06-28src/remembering-c.c: Fix usage of strcat()EuAndreh1-5/+5
As it turns out, after doing a malloc(), strcat() can't be used directly on top of it. I'd guess that the implementation of strcat() goes through the first string until its end, the \0 NULL terminator, and then starts copying the characters to the new string, overwriting the existing terminator to allow the string to actually be continuous. However, strcat() can't do this in a string that was just malloced and has no content. So it will probably run over the end of the memory untill it finds a NULL byte, and concatenate starting from that. I didn't check this elsewhere, but this explanation sounds reasonable, and Valgrind's diagnostics seem to confirm that. The solution is to strcpy() the first string, and than strcat() the others after that, so that strcat() has an existing string to work on, while strcpy doesn't need that. Fixes #task-bd165b74-c559-48ee-1d29-eaa906aa0393.
2021-06-28src/remembering-c.c: Use better grouping of parentheses for strcmp()EuAndreh1-1/+1
2021-06-28git mv tests/tests-lib.sh tests/lib.shEuAndreh5-4/+4
2021-06-28TODOs.md: Add #task-06c8ef1b-15ed-5932-3391-8c02ff759e7aEuAndreh1-0/+3
2021-06-28tests/ranking.sh: Add test_pick_inexisting_value, disabledEuAndreh1-0/+35
2021-06-28tests/*.sh: Refactor error messages to be consistent, move helper all helper ↵EuAndreh2-47/+48
funtions to the top
2021-06-28TODOs.md: Add #task-f5a3d036-f451-f469-56f6-73274162df8eEuAndreh1-0/+3
2021-06-27TODOs.md: Add #task-bd165b74-c559-48ee-1d29-eaa906aa0393EuAndreh1-0/+3
2021-06-27mv {aux => tests}/tests-lib.shEuAndreh5-4/+4
2021-06-27src/unit-test.h: Make its output equal to aux/tests-lib.shEuAndreh1-1/+1
2021-06-27TODOs.md: Add #task-20f96d7d-2fd8-7a5f-e861-ded565c3b408EuAndreh1-0/+3
2021-06-27src/remembering-c.c: Add tests for mkdir_p()EuAndreh1-3/+49
2021-06-27src/remembering-c.c: Mark as static two functions leftEuAndreh1-2/+2
2021-06-27src/remembering-c.c: Add mkdir_pEuAndreh1-4/+52
2021-06-27src/remembering-c.c: Provide more precise location of errors for perror()EuAndreh1-6/+6
2021-06-27Makefile: Use DEFS over CFLAGS for definesEuAndreh1-2/+5
2021-06-27src/remembering-c.c: Add unit tests for get_profile_file()EuAndreh2-5/+164
Those tests led me to handling the case where $XDG_DATA_HOME was set, but as an empty string. This is the equivalent of the "[ -z ".." ]" test. I also parameterized get_profile_file() to receive the stream where it should write to in case of failing to getenv("HOME"). Even though this makes the arguments of functions that print longer, it looks like an overall good pattern. It is the equivalent of every sh function printing to STDOUT, and let the caller decide if it should go to STDOUT or STDERR.
2021-06-27src/remembering-c.c: Add get_profile_file()EuAndreh1-0/+54
2021-06-27src/remembering-c.c: Mark all functions as staticEuAndreh1-3/+3
2021-06-27TODOs.md: Add #task-b3261473-9d12-9df4-cbfe-c4017ffed709EuAndreh1-0/+3
2021-06-27tests/cli-opts.sh: Add N=$LINENOEuAndreh1-0/+21
2021-06-27TODOs.md: Add #task-013534fe-8839-9de1-ec4a-9d63980fc096EuAndreh1-0/+3
2021-06-27src/remembering.in: Stop ignoring unrecognized flagsEuAndreh2-1/+25
2021-06-27src/remembering.in: Don't look for --help and --version flags after --EuAndreh1-8/+16
2021-06-27src/remembering.in: Fix ShellCheck offense, remove disableEuAndreh1-2/+1
2021-06-27src/remembering.in: Better instruction on looking at manpage in help stringEuAndreh1-1/+1
2021-06-27src/remembering.in: Fix syntax of help string output optionsEuAndreh1-2/+2