+ strvec2 = EC_STRVEC("0", "1");
+ if (strvec2 == NULL) {
+ EC_TEST_ERR("cannot create strvec from array\n");
+ goto fail;
+ }
+ testres |= EC_TEST_CHECK(ec_strvec_cmp(strvec, strvec2) == 0,
+ "strvec and strvec2 should be equal\n");
+ ec_strvec_free(strvec2);
+
+ f = open_memstream(&buf, &buflen);
+ if (f == NULL)
+ goto fail;
+ ec_strvec_dump(f, strvec);
+ fclose(f);
+ f = NULL;
+ testres |= EC_TEST_CHECK(
+ strstr(buf, "strvec (len=2) [0, 1]"), "bad dump\n");
+ free(buf);
+ buf = NULL;
+
+ ec_strvec_del_last(strvec);
+ strvec2 = EC_STRVEC("0");
+ if (strvec2 == NULL) {
+ EC_TEST_ERR("cannot create strvec from array\n");
+ goto fail;
+ }
+ testres |= EC_TEST_CHECK(ec_strvec_cmp(strvec, strvec2) == 0,
+ "strvec and strvec2 should be equal\n");
+ ec_strvec_free(strvec2);
+ strvec2 = NULL;
+
+ f = open_memstream(&buf, &buflen);
+ if (f == NULL)
+ goto fail;
+ ec_strvec_dump(f, NULL);
+ fclose(f);
+ f = NULL;
+ testres |= EC_TEST_CHECK(
+ strstr(buf, "none"), "bad dump\n");
+ free(buf);
+ buf = NULL;