diff options
author | Thomas White <taw@bitwiz.org.uk> | 2014-09-14 11:13:43 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2014-09-14 11:13:43 +0200 |
commit | ec4f394db8d6b74da01fa98a24a4e111f06b223d (patch) | |
tree | b7b7b869f3dc8cba3d455f7a1015ce000e6020d6 | |
parent | 7b302ea4b906b162c37c3370434165f6e83a9def (diff) |
Fix tests
-rw-r--r-- | src/sc_interp.c | 2 | ||||
-rw-r--r-- | tests/render_test.c | 2 | ||||
-rw-r--r-- | tests/render_test_sc1.c | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c index 541c259..2a07ced 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -761,6 +761,8 @@ void add_macro(SCInterpreter *scin, const char *mname, const char *contents) void sc_interp_run_stylesheet(SCInterpreter *scin, SCBlock *bl) { + if ( bl == NULL ) return; + if ( strcmp(sc_block_name(bl), "stylesheet") != 0 ) { fprintf(stderr, "Style sheet isn't a style sheet.\n"); return; diff --git a/tests/render_test.c b/tests/render_test.c index faaf1c4..0e7c3c9 100644 --- a/tests/render_test.c +++ b/tests/render_test.c @@ -97,7 +97,9 @@ int main(int argc, char *argv[]) s.rendered_proj = NULL; s.rendered_thumb = NULL; s.parent = &p; + s.scblocks = fr->scblocks; + p.stylesheet = NULL; p.scblocks = fr->scblocks; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); diff --git a/tests/render_test_sc1.c b/tests/render_test_sc1.c index bf60241..d8172cd 100644 --- a/tests/render_test_sc1.c +++ b/tests/render_test_sc1.c @@ -36,7 +36,7 @@ #include "../src/frame.h" -const char *sc = "\\demo{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. \\f[0.5fx0.5f+100+40]{\\bgcol[#ff00ff]Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.} Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.}"; +const char *sc = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. \\f[0.5fx0.5f+100+40]{\\bgcol[#ff00ff]Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.} Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est."; static gint mw_destroy(GtkWidget *w, void *p) @@ -95,8 +95,10 @@ int main(int argc, char *argv[]) s.rendered_proj = NULL; s.rendered_thumb = NULL; s.parent = &p; + s.scblocks = fr->scblocks; p.scblocks = fr->scblocks; + p.stylesheet = NULL; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |