logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git

bookmarks_test.c (843B)


  1. // BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser
  2. // SPDX-FileCopyrightText: 2019-2022 Badwolf Authors <https://hacktivis.me/projects/badwolf>
  3. // SPDX-License-Identifier: MPL-2.0
  4. #include "bookmarks.h"
  5. #include <glib.h>
  6. #include <gtk/gtk.h>
  7. #include <stdlib.h> /* setenv */
  8. static void
  9. bookmarks_completion_init_test(void)
  10. {
  11. GtkTreeModel *result;
  12. char *filename = g_build_filename(g_get_current_dir(), "bookmarks_test.fixtures/full/", NULL);
  13. g_assert_true(setenv("XDG_DATA_HOME", filename, 1) == 0);
  14. result = bookmarks_completion_init();
  15. g_assert_true(result != NULL);
  16. g_free(filename);
  17. g_assert_true(unsetenv("XDG_DATA_HOME") == 0);
  18. }
  19. int
  20. main(int argc, char *argv[])
  21. {
  22. g_test_init(&argc, &argv, NULL);
  23. g_test_add_func("/bookmarks_completion_init/test", bookmarks_completion_init_test);
  24. return g_test_run();
  25. }