sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[tests] Fix and test value type string of topology primitives

Open alxbilger opened this issue 1 year ago • 9 comments

Note that Point does not pass the test

The introduced tests don't pass on non-Windows OS


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

alxbilger avatar May 13 '24 11:05 alxbilger

What does Point return @alxbilger ?

hugtalbot avatar May 13 '24 11:05 hugtalbot

Element<Point> and vector<Element<Point>,CPUMemoryManager<Element<Point>>>

alxbilger avatar May 13 '24 11:05 alxbilger

Maybe Element<Point> does not make sense...

alxbilger avatar May 13 '24 11:05 alxbilger

and do you know why this? maybe @epernod would know this

hugtalbot avatar May 13 '24 13:05 hugtalbot

I tried and on macOS and Ubuntu/gcc :

  • EXPECT_EQ(std::string{sofa::geometry::ElementInfo<sofa::geometry::Point>::name()}, "Point"); test passes
  • EXPECT_EQ(defaulttype::DataTypeName<sofa::topology::Element<sofa::geometry::Point> >::name(), "Point"); does not (return Element<Point> as you said)

After some investigation, DataTypeInfo<topo::Element<geo::Point> does not exist so it uses the default decoder. IMO, It was not implemented because topology::Point (which should be an alias on topo::Element<geo::Point>) is not defined. I dont remember why it was not done while Sofa.Topo and Sofa.Geo was created. Maybe topology::Point does not make sense ? (in a topology point of view) If in the end it does, making the alias (and adding the typeinfo) does work. (see https://github.com/alxbilger/sofa/pull/8 )

fredroy avatar May 14 '24 02:05 fredroy

@lamriaimen could you try that with this branch you don't have any widget registration issue with SofaImGui ? Thanks

alxbilger avatar May 15 '24 13:05 alxbilger

[ci-test][with-all-tests]

alxbilger avatar May 15 '24 13:05 alxbilger

@alxbilger no errors were generated when i tried to run it with imgu. the problem of "[DataWidgetFactory] Cannot add widget vector<> into the factory" is solved i guess.

lamriaimen avatar May 15 '24 15:05 lamriaimen

[ci-build][with-all-tests]

alxbilger avatar May 18 '24 16:05 alxbilger