diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-08-02 11:05:33 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-08-02 11:05:33 +0200 |
| commit | 5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde (patch) | |
| tree | 80911dc3c32e9f230750e7e1042d413dfb6efab2 /test/src/ht/test_ftht_entry_new.c | |
| parent | ee32953ea79616e72f5428cdf40c834714a891c9 (diff) | |
| parent | b96b82194ccad2cddbb46b77aa1962a57c47ff44 (diff) | |
| download | libft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.tar.gz libft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.tar.bz2 libft-5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde.zip | |
Merge branch 'master' into ft_ssl
Diffstat (limited to 'test/src/ht/test_ftht_entry_new.c')
| -rw-r--r-- | test/src/ht/test_ftht_entry_new.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/src/ht/test_ftht_entry_new.c b/test/src/ht/test_ftht_entry_new.c new file mode 100644 index 0000000..a566600 --- /dev/null +++ b/test/src/ht/test_ftht_entry_new.c @@ -0,0 +1,43 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test_ft_htentry_new.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/17 04:07:04 by cacharle #+# #+# */ +/* Updated: 2020/02/17 04:15:39 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_test.h" + +TEST_GROUP(ft_htentry_new); + +TEST_SETUP(ft_htentry_new) +{} + +TEST_TEAR_DOWN(ft_htentry_new) +{} + +TEST(ft_htentry_new, basic) +{ + t_ftht_entry *c = NULL; + + char *k = "bonjour"; + c = ft_htentry_new(k, NULL); + TEST_ASSERT_NOT_NULL(c); + TEST_ASSERT(k != c->key); + TEST_ASSERT_EQUAL_STRING(k, c->key); + TEST_ASSERT_NULL(c->value); + + c = ft_htentry_new(k, k); + TEST_ASSERT_NOT_NULL(c); + TEST_ASSERT(k != c->key); + TEST_ASSERT_EQUAL_STRING(k, c->key); + TEST_ASSERT_EQUAL_PTR(k, c->value); + TEST_ASSERT_EQUAL_STRING(k, (char*)c->value); + + /* free(c->key); */ + /* free(c); */ +} |
