Пример #1
0
	Interpolation FromString(const fm::string& value)
	{
		if (value == DAE_STEP_INTERPOLATION) return STEP;
		else if (value == DAE_LINEAR_INTERPOLATION) return LINEAR;
		else if (value == DAE_BEZIER_INTERPOLATION) return BEZIER;
		else if (value == DAE_TCB_INTERPOLATION) return TCB;
		else if (value.empty()) return BEZIER; // COLLADA 1.4.1, p4.92: application defined

		else return UNKNOWN;
	}
Пример #2
0
	PassIf(b.find("TEST1", 2) == 5);
	PassIf(b.find("TEST1", 5) == 5);
	PassIf(b.find("TEST1", 7) == fm::string::npos);
	FailIf(c.find("TEST1") != fm::string::npos);
	PassIf(IsEquivalent(a.c_str(), "TEST1"));
	PassIf(d.find_first_of("RST") == 2);
	PassIf(c.find_last_of("T") == 3);

	e.erase(3, 4);
	a.erase(0, fm::string::npos);
	b.clear();
	PassIf(IsEquivalent(e, "CCC"));
	PassIf(e.find_first_of("TEST1ORANYTHINGELSETHATDOESNOTHAVE_?_") == fm::string::npos);
	PassIf(a.length() == 0);
	PassIf(IsEquivalent(a, ""));
	PassIf(a.empty());
	PassIf(a == b);
	PassIf(a.empty());
	PassIf(IsEquivalent(a.c_str(), b)); // c_str() will ensure that the vector<char> is NULL-terminated.
	PassIf(a.empty());
	PassIf(a == b);
	
	a.append('C');
	PassIf(IsEquivalent(a, "C"));
	a.append('D');
	PassIf(IsEquivalent(a, "CD"));
	a.insert(1, "S");
	PassIf(IsEquivalent(a, "CSD"));

TESTSUITE_TEST(2, SubTestSuites)
	RUN_TESTSUITE(FUStringBuilder);