mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Update native with my_isnan fix
This commit is contained in:
parent
349e18982c
commit
1c17c9138e
2 changed files with 18 additions and 6 deletions
2
native
2
native
|
@ -1 +1 @@
|
||||||
Subproject commit 4cc3c5079af162f224418889f53a8721361a4ede
|
Subproject commit 1b471762427f8699fe08eaa267537c49a43c2faf
|
|
@ -25,13 +25,18 @@
|
||||||
// Or just integrate with an existing testing framework.
|
// Or just integrate with an existing testing framework.
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Common/ArmEmitter.h"
|
#include "Common/ArmEmitter.h"
|
||||||
#include "ext/disarm.h"
|
#include "ext/disarm.h"
|
||||||
|
#include "math/math_util.h"
|
||||||
|
|
||||||
|
#define EXPECT_TRUE(a) if (!(a)) { printf(__FUNCTION__ ":%i: Test Fail\n", __LINE__); return false; }
|
||||||
|
#define EXPECT_FALSE(a) if ((a)) { printf(__FUNCTION__ ":%i: Test Fail\n", __LINE__); return false; }
|
||||||
|
#define EXPECT_EQ_FLOAT(a, b) if ((a) != (b)) { printf(__FUNCTION__ ":" __LINE__ ": Test Fail\n%f\nvs\n%f\n", a, b); return false; }
|
||||||
#define EXPECT_EQ_STR(a, b) if ((a) != (b)) { printf(__FUNCTION__ ": Test Fail\n%s\nvs\n%s\n", a.c_str(), b.c_str()); return false; }
|
#define EXPECT_EQ_STR(a, b) if ((a) != (b)) { printf(__FUNCTION__ ": Test Fail\n%s\nvs\n%s\n", a.c_str(), b.c_str()); return false; }
|
||||||
|
|
||||||
bool TestArmEmitter() {
|
bool TestArmEmitter() {
|
||||||
|
@ -44,15 +49,22 @@ bool TestArmEmitter() {
|
||||||
char disasm[512];
|
char disasm[512];
|
||||||
ArmDis(0, code[0] & 0xFFFFFFFF, disasm);
|
ArmDis(0, code[0] & 0xFFFFFFFF, disasm);
|
||||||
std::string dis(disasm);
|
std::string dis(disasm);
|
||||||
EXPECT_EQ_STR(dis, std::string("e4973000 LDR r3, [r7], #0"));
|
EXPECT_EQ_STR(dis, std::string("e4973000 LDR r3, [r7, #0]"));
|
||||||
|
|
||||||
printf("TestArmEmitter: Success\n");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TestMathUtil() {
|
||||||
|
EXPECT_FALSE(my_isinf(1.0));
|
||||||
|
volatile float zero = 0.0f;
|
||||||
|
EXPECT_TRUE(my_isinf(1.0f/zero));
|
||||||
|
EXPECT_FALSE(my_isnan(1.0f/zero));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
TestArmEmitter();
|
TestArmEmitter();
|
||||||
|
TestMathUtil();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue