PuzzleSDK
MathUtilTest类 参考

#include <UnitTest.h>

+ 类 MathUtilTest 继承关系图:
+ MathUtilTest 的协作图:

Public 成员函数

 CREATE_FUNC (MathUtilTest)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 UnitTestDemo
virtual std::string title () const override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 UnitTest.h99 行定义.

成员函数说明

◆ CREATE_FUNC()

MathUtilTest::CREATE_FUNC ( MathUtilTest  )

◆ onEnter()

void MathUtilTest::onEnter ( )
overridevirtual

重载 TestCase .

在文件 UnitTest.cpp1495 行定义.

1496{
1498
1499 const int MAT4_SIZE = 16;
1500 const int VEC4_SIZE = 4;
1501
1502 const float inMat41[MAT4_SIZE] = {
1503 0.234023f, 2.472349f, 1.984244f, 2.23348f,
1504 0.634124f, 0.234975f, 6.384572f, 0.82368f,
1505 0.738028f, 1.845237f, 1.934721f, 1.62343f,
1506 0.339023f, 3.472452f, 1.324714f, 4.23852f,
1507 };
1508
1509 const float inMat42[MAT4_SIZE] = {
1510 1.640232f, 4.472349f, 0.983244f, 1.23343f,
1511 2.834124f, 8.234975f, 0.082572f, 3.82464f,
1512 3.238028f, 2.845237f, 0.331721f, 4.62544f,
1513 4.539023f, 9.472452f, 3.520714f, 2.23252f,
1514 };
1515
1516 const float scalar = 1.323298f;
1517 const float x = 0.432234f;
1518 const float y = 1.333229f;
1519 const float z = 2.535292f;
1520 const float w = 4.632234f;
1521
1522 const float inVec4[VEC4_SIZE] = {2.323478f, 0.238482f, 4.223783f, 7.238238f};
1523 const float inVec42[VEC4_SIZE] = {0.322374f, 8.258883f, 3.293683f, 2.838337f};
1524
1525 float outMat4Opt[MAT4_SIZE] = {0};
1526 float outMat4C[MAT4_SIZE] = {0};
1527 float outVec4Opt[VEC4_SIZE] = {0};
1528 float outVec4C[VEC4_SIZE] = {0};
1529
1530 // inline static void addMatrix(const float* m, float scalar, float* dst);
1531 MathUtilC::addMatrix(inMat41, scalar, outMat4C);
1532
1533#ifdef INCLUDE_NEON32
1534 MathUtilNeon::addMatrix(inMat41, scalar, outMat4Opt);
1535#endif
1536
1537#ifdef INCLUDE_NEON64
1538 MathUtilNeon64::addMatrix(inMat41, scalar, outMat4Opt);
1539#endif
1540
1541#ifdef INCLUDE_SSE
1542// FIXME:
1543#endif
1544
1545 __checkMathUtilResult("inline static void addMatrix(const float* m, float scalar, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1546 // Clean
1547 memset(outMat4C, 0, sizeof(outMat4C));
1548 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1549
1550 // inline static void addMatrix(const float* m1, const float* m2, float* dst);
1551 MathUtilC::addMatrix(inMat41, inMat42, outMat4C);
1552
1553#ifdef INCLUDE_NEON32
1554 MathUtilNeon::addMatrix(inMat41, inMat42, outMat4Opt);
1555#endif
1556
1557#ifdef INCLUDE_NEON64
1558 MathUtilNeon64::addMatrix(inMat41, inMat42, outMat4Opt);
1559#endif
1560
1561#ifdef INCLUDE_SSE
1562 // FIXME:
1563#endif
1564
1565 __checkMathUtilResult("inline static void addMatrix(const float* m1, const float* m2, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1566 // Clean
1567 memset(outMat4C, 0, sizeof(outMat4C));
1568 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1569
1570 // inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
1571 MathUtilC::subtractMatrix(inMat41, inMat42, outMat4C);
1572
1573#ifdef INCLUDE_NEON32
1574 MathUtilNeon::subtractMatrix(inMat41, inMat42, outMat4Opt);
1575#endif
1576
1577#ifdef INCLUDE_NEON64
1578 MathUtilNeon64::subtractMatrix(inMat41, inMat42, outMat4Opt);
1579#endif
1580
1581#ifdef INCLUDE_SSE
1582 // FIXME:
1583#endif
1584
1585 __checkMathUtilResult("inline static void subtractMatrix(const float* m1, const float* m2, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1586 // Clean
1587 memset(outMat4C, 0, sizeof(outMat4C));
1588 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1589
1590 // inline static void multiplyMatrix(const float* m, float scalar, float* dst);
1591 MathUtilC::multiplyMatrix(inMat41, scalar, outMat4C);
1592
1593#ifdef INCLUDE_NEON32
1594 MathUtilNeon::multiplyMatrix(inMat41, scalar, outMat4Opt);
1595#endif
1596
1597#ifdef INCLUDE_NEON64
1598 MathUtilNeon64::multiplyMatrix(inMat41, scalar, outMat4Opt);
1599#endif
1600
1601#ifdef INCLUDE_SSE
1602 // FIXME:
1603#endif
1604
1605 __checkMathUtilResult("inline static void multiplyMatrix(const float* m, float scalar, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1606 // Clean
1607 memset(outMat4C, 0, sizeof(outMat4C));
1608 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1609
1610 // inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
1611 MathUtilC::multiplyMatrix(inMat41, inMat42, outMat4C);
1612
1613#ifdef INCLUDE_NEON32
1614 MathUtilNeon::multiplyMatrix(inMat41, inMat42, outMat4Opt);
1615#endif
1616
1617#ifdef INCLUDE_NEON64
1618 MathUtilNeon64::multiplyMatrix(inMat41, inMat42, outMat4Opt);
1619#endif
1620
1621#ifdef INCLUDE_SSE
1622 // FIXME:
1623#endif
1624
1625 __checkMathUtilResult("inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1626 // Clean
1627 memset(outMat4C, 0, sizeof(outMat4C));
1628 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1629
1630 // inline static void negateMatrix(const float* m, float* dst);
1631 MathUtilC::negateMatrix(inMat41, outMat4C);
1632
1633#ifdef INCLUDE_NEON32
1634 MathUtilNeon::negateMatrix(inMat41, outMat4Opt);
1635#endif
1636
1637#ifdef INCLUDE_NEON64
1638 MathUtilNeon64::negateMatrix(inMat41, outMat4Opt);
1639#endif
1640
1641#ifdef INCLUDE_SSE
1642 // FIXME:
1643#endif
1644
1645 __checkMathUtilResult("inline static void negateMatrix(const float* m, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1646 // Clean
1647 memset(outMat4C, 0, sizeof(outMat4C));
1648 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1649
1650 // inline static void transposeMatrix(const float* m, float* dst);
1651 MathUtilC::transposeMatrix(inMat41, outMat4C);
1652
1653#ifdef INCLUDE_NEON32
1654 MathUtilNeon::transposeMatrix(inMat41, outMat4Opt);
1655#endif
1656
1657#ifdef INCLUDE_NEON64
1658 MathUtilNeon64::transposeMatrix(inMat41, outMat4Opt);
1659#endif
1660
1661#ifdef INCLUDE_SSE
1662 // FIXME:
1663#endif
1664
1665 __checkMathUtilResult("inline static void transposeMatrix(const float* m, float* dst);", outMat4C, outMat4Opt, MAT4_SIZE);
1666 // Clean
1667 memset(outMat4C, 0, sizeof(outMat4C));
1668 memset(outMat4Opt, 0, sizeof(outMat4Opt));
1669
1670 // inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);
1671 MathUtilC::transformVec4(inMat41, x, y, z, w, outVec4C);
1672
1673#ifdef INCLUDE_NEON32
1674 MathUtilNeon::transformVec4(inMat41, x, y, z, w, outVec4Opt);
1675#endif
1676
1677#ifdef INCLUDE_NEON64
1678 MathUtilNeon64::transformVec4(inMat41, x, y, z, w, outVec4Opt);
1679#endif
1680
1681#ifdef INCLUDE_SSE
1682 // FIXME:
1683#endif
1684
1685 __checkMathUtilResult("inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst);", outVec4C, outVec4Opt, VEC4_SIZE);
1686 // Clean
1687 memset(outVec4C, 0, sizeof(outVec4C));
1688 memset(outVec4Opt, 0, sizeof(outVec4Opt));
1689
1690 // inline static void transformVec4(const float* m, const float* v, float* dst);
1691 MathUtilC::transformVec4(inMat41, inVec4, outVec4C);
1692
1693#ifdef INCLUDE_NEON32
1694 MathUtilNeon::transformVec4(inMat41, inVec4, outVec4Opt);
1695#endif
1696
1697#ifdef INCLUDE_NEON64
1698 MathUtilNeon64::transformVec4(inMat41, inVec4, outVec4Opt);
1699#endif
1700
1701#ifdef INCLUDE_SSE
1702 // FIXME:
1703#endif
1704
1705 __checkMathUtilResult("inline static void transformVec4(const float* m, const float* v, float* dst);", outVec4C, outVec4Opt, VEC4_SIZE);
1706 // Clean
1707 memset(outVec4C, 0, sizeof(outVec4C));
1708 memset(outVec4Opt, 0, sizeof(outVec4Opt));
1709
1710 // inline static void crossVec3(const float* v1, const float* v2, float* dst);
1711 MathUtilC::crossVec3(inVec4, inVec42, outVec4C);
1712
1713#ifdef INCLUDE_NEON32
1714 MathUtilNeon::crossVec3(inVec4, inVec42, outVec4Opt);
1715#endif
1716
1717#ifdef INCLUDE_NEON64
1718 MathUtilNeon64::crossVec3(inVec4, inVec42, outVec4Opt);
1719#endif
1720
1721#ifdef INCLUDE_SSE
1722 // FIXME:
1723#endif
1724
1725 __checkMathUtilResult("inline static void crossVec3(const float* v1, const float* v2, float* dst);", outVec4C, outVec4Opt, VEC4_SIZE);
1726 // Clean
1727 memset(outVec4C, 0, sizeof(outVec4C));
1728 memset(outVec4Opt, 0, sizeof(outVec4Opt));
1729}
static void __checkMathUtilResult(const char *description, const float *a1, const float *a2, int size)
Definition: UnitTest.cpp:1476
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 __checkMathUtilResult() , 以及 TestCase::onEnter().

+ 函数调用图:

◆ subtitle()

std::string MathUtilTest::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 UnitTest.cpp1731 行定义.

1732{
1733 return "MathUtilTest";
1734}

该类的文档由以下文件生成: