Giter Club home page Giter Club logo

Comments (3)

pischky avatar pischky commented on June 9, 2024

May be a solution is to use remove_reference:

#define ASSERT_EQ(expected, actual)                     \
    assertEqual(                                        \
        static_cast< std::remove_reference<             \
                decltype(actual) >::type >(expected),   \
        actual)

But remove_reference is not support in current Arduino version (1.8.19) so you need also ArxTypeTraits 0.2.3 by Hideaki Tai.

from aunit.

bxparks avatar bxparks commented on June 9, 2024

Maybe the solution is to remove the static_cast<decltype(a)>? See if the following helps:
https://github.com/bxparks/AUnit/tree/gtest_ref_cast
It fixes your specific problem.

I don't have any code that uses <gtest.h>, and I'm not entirely sure I understand all the edge cases of the Google Test framework, so not really sure if this is the best solution.

from aunit.

pischky avatar pischky commented on June 9, 2024

Thanks for your suggestion to remove the static_cast. Yes
that fixes my problem. I thought the static_cast has
the intention to select the correct function from
the set of overloaded assertEqual(). I hoped be the original
author of gtest.h did know.

I'm porting some Tests from x86 to arduino. So I'm doing further
testing with my variant using remove_reference.
So far it seems to work fine. Only disadvantage is that ArxTypeTraits
is required.

from aunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.