/** @file * @author Edouard DUPIN * @copyright 2016, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #include #include #include #include #include int main(int _argc, const char *_argv[]) { // init Google test : ::testing::InitGoogleTest(&_argc, const_cast(_argv)); // init etk log system and file interface: etk::init(_argc, _argv); // Run all test with etest return RUN_ALL_TESTS(); } TEST(TestAll, plop) { /* dollar::Gesture gest; gest.set("test", 55, dollar::loadPoints("DATA:test/P.json")); gest.configure(0.1, 64, false, 0.1f); */ } /* * single-stroke gesture recognition */ TEST(TestAll, singleStroke_normal) { ememory::SharedPtr reco = dollar::createEngine("$N"); reco->loadPath("DATA:figure"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/arrow.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "arrow"); TEST_INFO("Results"); for (size_t iii=0; iiiloadPath("DATA:figure"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/arrow.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "arrow"); TEST_INFO("Results"); for (size_t iii=0; iiiloadPath("DATA:text"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/P.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "P"); TEST_INFO("Results"); for (size_t iii=0; iiiloadPath("DATA:text"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/P.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "P"); TEST_INFO("Results"); for (size_t iii=0; iiiloadPath("DATA:text"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/P.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "P"); TEST_INFO("Results"); for (size_t iii=0; iiiloadPath("DATA:text"); dollar::Results res = reco->recognize(dollar::loadPoints("DATA:test/P.json")); EXPECT_EQ(res.haveMath(), true); if (res.haveMath() == false) { TEST_INFO(" Recognise noting ..."); return; } EXPECT_EQ(res.getName(), "P"); TEST_INFO("Results"); for (size_t iii=0; iii