test_ModuleMath.cpp 570 B

12345678910111213141516171819202122
  1. #include <gtest/gtest.h>
  2. #include <json.hpp>
  3. //#define private public
  4. #include <ModuleMath.h>
  5. using namespace mdd;
  6. TEST(ModuleMath, INT_PLUS_Int){
  7. ModuleMath test = ModuleMath();
  8. test.update();
  9. EXPECT_EQ(test.getOutput(0)->getValue()["value"].get<int>(), 2);
  10. }
  11. TEST(ModuleMath, ARRAYINT_PLUS_ARRAYInt){
  12. ModuleMath test = ModuleMath();
  13. test.setInputDefaultValue(0)["value"] = {1,2,3,45};
  14. test.setInputDefaultValue(1)["value"] = {10,31,23,23};
  15. test.update();
  16. EXPECT_EQ(test.getOutput(0)->getValue()["value"].dump(), "{11,33,26,68}");
  17. }