tests CHANGE setting up searchdirs via ly_ctx_new()
@@ -152,6 +152,21 @@ test_searchdirs(void **state)
assert_int_equal(LY_SUCCESS, ly_ctx_unset_searchdirs(ctx, -5));
assert_int_equal(0, ctx->search_paths.count);
+ /* again - no change */
+ assert_int_equal(LY_SUCCESS, ly_ctx_unset_searchdirs(ctx, -1));
+
+ /* cleanup */
+ ly_ctx_destroy(ctx, NULL);
+
+ /* test searchdir list in ly_ctx_new() */
+ assert_int_equal(LY_EINVAL, ly_ctx_new("/nonexistingfile", 0, &ctx));
+ logbuf_assert("Unable to use search directory \"/nonexistingfile\" (No such file or directory)");
+ assert_int_equal(LY_SUCCESS, ly_ctx_new(TESTS_SRC":/tmp", 0, &ctx));
+ assert_int_equal(2, ctx->search_paths.count);
+ assert_string_equal(TESTS_SRC, ctx->search_paths.objs[0]);
+ assert_string_equal("/tmp", ctx->search_paths.objs[1]);
+
+ /* cleanup */
ly_ctx_destroy(ctx, NULL);
}
