Beispiel #1
0
DSPDisassembler::~DSPDisassembler()
{
	// Some old code for logging unknown ops.
	std::string filename = File::GetUserPath(D_DUMPDSP_IDX) + "UnkOps.txt";
	File::IOFile uo(filename, "w");
	if (!uo)
		return;

	int count = 0;
	for (std::map<u16, int>::const_iterator iter = unk_opcodes.begin();
		iter != unk_opcodes.end(); ++iter)
	{
		if (iter->second > 0)
		{
			count++;
			fprintf(uo.GetHandle(), "OP%04x\t%d", iter->first, iter->second);
			for (int j = 15; j >= 0; j--)  // print op bits
			{
				if ((j & 0x3) == 3)
					fprintf(uo.GetHandle(), "\tb");
				fprintf(uo.GetHandle(), "%d", (iter->first >> j) & 0x1);
			}
			fprintf(uo.GetHandle(), "\n");
		}
	}
Beispiel #2
0
DSPDisassembler::~DSPDisassembler()
{
	// Some old code for logging unknown ops.
	std::string filename = File::GetUserPath(D_DUMPDSP_IDX) + "UnkOps.txt";
	File::IOFile uo(filename, "w");
	if (!uo)
		return;

	int count = 0;
	for (const auto& entry : unk_opcodes)
	{
		if (entry.second > 0)
		{
			count++;
			fprintf(uo.GetHandle(), "OP%04x\t%d", entry.first, entry.second);
			for (int j = 15; j >= 0; j--)  // print op bits
			{
				if ((j & 0x3) == 3)
					fprintf(uo.GetHandle(), "\tb");
				fprintf(uo.GetHandle(), "%d", (entry.first >> j) & 0x1);
			}
			fprintf(uo.GetHandle(), "\n");
		}
	}
TEST(overloadedMethodsTest,TestBindIntSuccess)
{
   GLSLParser::UniformObject uo("iTest",GLSLParser::GLSLinteger);
   ASSERT_NO_THROW(uo.bind(5));
}
TEST(overloadedMethodsTest, testGlmVec2Success)
{
   GLSLParser::UniformObject uo("v2Test",GLSLParser::GLSLvector2);
   ASSERT_NO_THROW(uo.bind(glm::vec2(1.0,2.0)));
}
TEST(overloadedMethodsTest, testGlmVec2Failure)
{
   GLSLParser::UniformObject uo("v2Test",GLSLParser::GLSLvector2);
   ASSERT_THROW(uo.bind(1),GLSLParser::GLSLTypeException);
}
TEST(overloadedMethodsTest, testBindBoolFailure)
{
   GLSLParser::UniformObject uo("bTest",GLSLParser::GLSLboolean);
   ASSERT_THROW(uo.bind(5),GLSLParser::GLSLTypeException);
}
TEST(overloadedMethodsTest, testBindBoolSuccess)
{
   GLSLParser::UniformObject uo("bTest",GLSLParser::GLSLboolean);
   ASSERT_NO_THROW(uo.bind(true));
}
TEST(overloadedMethodsTest, testBindFloatFailure)
{
   GLSLParser::UniformObject uo("iTest",GLSLParser::GLSLfloatingPt);
   ASSERT_THROW(uo.bind(5),GLSLParser::GLSLTypeException);
}
TEST(overloadedMethodsTest, testBindFloatSuccess)
{
   GLSLParser::UniformObject uo("fTest",GLSLParser::GLSLfloatingPt);
   ASSERT_NO_THROW(uo.bind(0.5f));
}
TEST(overloadedMethodsTest, TestBindIntFail)
{
   GLSLParser::UniformObject uo("fTest",GLSLParser::GLSLinteger);
   ASSERT_THROW(uo.bind(0.5f),GLSLParser::GLSLTypeException);
}