Code

initial implementation of XML::Subtree API for tracking changes on a
[inkscape.git] / src / style-test.cpp
index 86382b1743a9e53aabf4ae41360888c717f7d4cd..4bbd953e55cacacb0c1f963be517b186e244ef40 100644 (file)
@@ -223,7 +223,7 @@ static char const *const paint_enum_vals[] = {"none", "currentColor", NULL};
 static gchar *
 merge_then_write_string(gchar const *const str, guint const flags)
 {
-    SPStyle *const style = sp_style_new();
+    SPStyle *const style = sp_style_new(NULL);
     sp_style_merge_from_style_string(style, str);
     gchar *const ret = sp_style_write_string(style, flags);
     sp_style_unref(style);
@@ -249,7 +249,7 @@ static void
 color_val(char const prop[], char const *const dummy_vals[])
 {
     assert(dummy_vals == NULL);
-    char const *const extra_vals[] = {"#0000ff", NULL};
+    char const *const extra_vals[] = {"blue", "#234", "#0100ff", NULL};
     enum_val(prop, extra_vals);
 #if 0
     char const *color_vals[G_N_ELEMENTS(color_keywords) + G_N_ELEMENTS(extra_vals)];
@@ -432,8 +432,8 @@ test_scale24_mul()
 static void
 test_merge_opacity()
 {
-    SPStyle &parent = *sp_style_new();
-    SPStyle &child = *sp_style_new();
+    SPStyle &parent = *sp_style_new(NULL);
+    SPStyle &child = *sp_style_new(NULL);
 
     unsigned const either = 2;
     struct {
@@ -540,10 +540,10 @@ test_style()
         char const *const *tst_fn_arg;
         bool can_explicitly_inherit;
     } const props[] = {
-        {"color", "#000000", "#000000", color_val, NULL, true},
+        {"color", "black", "black", color_val, NULL, true},
         // initial value "depends on user agent"
         {"display", "inline", "inline", enum_val, display_vals, true},
-        {"fill", "#000000", "black", paint_val, NULL, true},
+        {"fill", "black", "black", paint_val, NULL, true},
         {"fill-opacity", "1", "1", opacity_val, NULL, true},
         {"fill-rule", "nonzero", "nonzero", enum_val, fill_rule_vals, true},
         {"font-family", "Bitstream Vera Sans", "Bitstream Vera Sans", font_family_val, NULL, true},
@@ -595,8 +595,8 @@ test_style()
         "writing-mode:lr-tb;"
         "text-anchor:start;"
         "opacity:1;"
-        "color:#000000;"
-        "fill:#000000;"
+        "color:black;"
+        "fill:black;"
         "fill-opacity:1;"
         "fill-rule:nonzero;"
         "stroke:none;"
@@ -618,12 +618,12 @@ test_style()
 
     utest_start("style");
     UTEST_TEST("sp_style_new, sp_style_write_string") {
-        SPStyle *style = sp_style_new();
+        SPStyle *style = sp_style_new(NULL);
+        g_assert(style);
         gchar *str0_all = sp_style_write_string(style, SP_STYLE_FLAG_ALWAYS);
         gchar *str0_set = sp_style_write_string(style, SP_STYLE_FLAG_IFSET);
         UTEST_ASSERT(*str0_set == '\0');
         UTEST_ASSERT(streq(str0_all, str0_all_exp));
-        printf(str0_all);
         g_free(str0_all);
         g_free(str0_set);
         sp_style_unref(style);
@@ -687,7 +687,7 @@ test_style()
                                                bad[i], bad[i]);
             UTEST_TEST(tst_name) {
                 gchar *str0_set = merge_then_write_string(style_str, SP_STYLE_FLAG_IFSET);
-                UTEST_ASSERT(streq(str0_set, "color:#112233"));
+                UTEST_ASSERT(streq(str0_set, "color:#123"));
                 g_free(str0_set);
             }
             g_free(style_str);