tiny-utf8 icon indicating copy to clipboard operation
tiny-utf8 copied to clipboard

Tests fail on i686

Open suve opened this issue 1 year ago • 0 comments

The test suite seems to assume that sizeof(tiny_utf8::string) is 32 chars and bases some asserts on this, e.g. inside AppendString:

	tiny_utf8::string str = U"Hello ツ";
	str.append(U" ♫ World");

	EXPECT_EQ(str.length(), 15);
	EXPECT_EQ(str.size(), 19);
	EXPECT_TRUE(str.requires_unicode());
	EXPECT_TRUE(str.sso_active());
	EXPECT_FALSE(str.lut_active());

However, on i686, sizeof(tiny_utf8::string) is 16 chars, which means the string literal used in this test is too large for SSO, and the EXPECT_TRUE(str.sso_active()) assertions fails.

Steps to reproduce

  1. Install 32-bit gtest and gmock libraries
  2. Build the test suite in 32-bit mode (e.g. using -DCMAKE_CXX_FLAGS="-m32")
  3. Run the test suite

suve avatar Mar 01 '25 12:03 suve