aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_next_algorithm.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-01 17:45:39 +0200
committerMattias Andrée <m@maandree.se>2026-05-01 17:45:39 +0200
commitadfa8e1265f6155d1a582baa9929af198bb5d4de (patch)
treee3cee62aa5a8768621cd294295f787b8cc54141b /librecrypt_next_algorithm.c
parentAdd librecrypt.7 and README (diff)
downloadlibrecrypt-adfa8e1265f6155d1a582baa9929af198bb5d4de.tar.gz
librecrypt-adfa8e1265f6155d1a582baa9929af198bb5d4de.tar.bz2
librecrypt-adfa8e1265f6155d1a582baa9929af198bb5d4de.tar.xz
Misc
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--librecrypt_next_algorithm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/librecrypt_next_algorithm.c b/librecrypt_next_algorithm.c
index b825582..8a44815 100644
--- a/librecrypt_next_algorithm.c
+++ b/librecrypt_next_algorithm.c
@@ -31,9 +31,10 @@ testcase_1(void)
EXPECT(!strcmp(s, "e$f$"));
EXPECT((a = librecrypt_next_algorithm(&s)));
- EXPECT(s == NULL);
+ EXPECT(s == NULL); /* state is set to NULL when done */
EXPECT(!strcmp(a, "e$f$"));
+ /* Check librecrypt_next_algorithm when done returns NULL without changing state */
EXPECT(librecrypt_next_algorithm(&s) == NULL);
EXPECT(s == NULL);
}
@@ -61,9 +62,10 @@ testcase_2(void)
EXPECT(!strcmp(s, ""));
EXPECT((a = librecrypt_next_algorithm(&s)));
- EXPECT(s == NULL);
+ EXPECT(s == NULL); /* state is set to NULL when done */
EXPECT(!strcmp(a, ""));
+ /* Check librecrypt_next_algorithm when done returns NULL without changing state */
EXPECT(librecrypt_next_algorithm(&s) == NULL);
EXPECT(s == NULL);
}