]> granicus.if.org Git - graphviz/commitdiff
add a warning message when using layout on a non-graph
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Jul 2021 04:18:23 +0000 (21:18 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Jul 2021 19:03:43 +0000 (12:03 -0700)
Closes #2078.

CHANGELOG.md
lib/cgraph/attr.c
rtest/test_regression.py

index 9c2171c1644eab926a90145529cb5c0d0153bdbe..6a8943e64d73819c0aa20dd0d83f2c493567e8bf 100644 (file)
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - the CMake build system now enables `-Wextra` when building C++
 - some Cgraph functions that take `char*` arguments that they do not modify have
   been updated to take `const char*` arguments #634
+- incorrectly using the `layout` attribute on anything other than a graph now
+  results in a warning about this being invalid #2078
 
 ## [2.48.0] - 2021-07-17
 
index 9815ef9824eb42e137949f88061092f595892534..0924bafb904daafdb06fa377924c9735b147380a 100644 (file)
@@ -263,6 +263,8 @@ static Agsym_t *setattr(Agraph_t * g, int kind, char *name, char *value)
     ldict = agdictof(g, kind);
     lsym = aglocaldictsym(ldict, name);
     if (lsym) {                        /* update old local definition */
+       if (g != root && streq(name, "layout"))
+           agerr(AGWARN, "layout attribute is invalid except on the root graph\n");
        agstrfree(g, lsym->defval);
        lsym->defval = agstrdup(g, value);
        rv = lsym;
index d37f32159f5a9740f4df9b5acdaaec58dece9517..eb6ab102cb6c047ba5415dacea8ae63e4ec8b07d 100644 (file)
@@ -1038,7 +1038,6 @@ def test_2057():
   ret, _, _ = run_c(c_src, link=["gvc"])
   assert ret == 0
 
-@pytest.mark.xfail(strict=True)
 def test_2078():
   """
   Incorrectly using the "layout" attribute on a subgraph should result in a