diff options
author | Christian Hergert <chergert@redhat.com> | 2022-07-22 15:31:22 -0700 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2022-07-22 15:31:22 -0700 |
commit | d03d0dee7b26bea3d7d55b01f627f112ab97cacd (patch) | |
tree | f50de022c2ab3f493709901f95a960249bc60997 /testsuite | |
parent | 950dbec19d28e9bdc462cc2a4024f3b3cbc6eb6a (diff) | |
download | gtksourceview-d03d0dee7b26bea3d7d55b01f627f112ab97cacd.tar.gz |
testsuite: check for NULL before usage
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/test-snippets.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/test-snippets.c b/testsuite/test-snippets.c index f30d3ca7..d84cb7bb 100644 --- a/testsuite/test-snippets.c +++ b/testsuite/test-snippets.c @@ -97,21 +97,21 @@ test_snippet_parse (void) g_assert_cmpint (4, ==, gtk_source_snippet_get_n_chunks (snippet)); chunk = gtk_source_snippet_get_nth_chunk (snippet, 0); + g_assert_nonnull (chunk); g_assert_cmpint (1, ==, gtk_source_snippet_chunk_get_focus_position (chunk)); g_assert_cmpstr ("test", ==, gtk_source_snippet_chunk_get_spec (chunk)); - g_assert_nonnull (chunk); chunk = gtk_source_snippet_get_nth_chunk (snippet, 1); + g_assert_nonnull (chunk); g_assert_cmpint (-1, ==, gtk_source_snippet_chunk_get_focus_position (chunk)); g_assert_cmpstr (" ", ==, gtk_source_snippet_chunk_get_spec (chunk)); - g_assert_nonnull (chunk); chunk = gtk_source_snippet_get_nth_chunk (snippet, 2); + g_assert_nonnull (chunk); g_assert_cmpint (2, ==, gtk_source_snippet_chunk_get_focus_position (chunk)); g_assert_cmpstr ("$1", ==, gtk_source_snippet_chunk_get_spec (chunk)); /* Unset until user types */ g_assert_cmpstr ("", ==, gtk_source_snippet_chunk_get_text (chunk)); - g_assert_nonnull (chunk); chunk = gtk_source_snippet_get_nth_chunk (snippet, 3); g_assert_cmpint (0, ==, gtk_source_snippet_chunk_get_focus_position (chunk)); |