void UCAConformanceTest::TestTableShifted(/* par */) { if (U_FAILURE(status)) { dataerrln("Error running UCA Conformance Test: %s", u_errorName(status)); return; } setCollShifted(UCA); openTestFile("SHIFTED"); testConformance(UCA); }
void UCAConformanceTest::TestTableNonIgnorable(/* par */) { if (U_FAILURE(status)) { dataerrln("Error running UCA Conformance Test: %s", u_errorName(status)); return; } setCollNonIgnorable(UCA); openTestFile("NON_IGNORABLE"); testConformance(UCA); }
void UCAConformanceTest::TestRulesNonIgnorable(/* par */) { initRbUCA(); if(U_SUCCESS(status)) { setCollNonIgnorable(rbUCA); openTestFile("NON_IGNORABLE"); testConformance(rbUCA); } }
void UCAConformanceTest::TestRulesNonIgnorable(/* par */) { if(logKnownIssue("cldrbug:6745", "UCARules.txt has problems")) { return; } initRbUCA(); if(U_SUCCESS(status)) { setCollNonIgnorable(rbUCA); openTestFile("NON_IGNORABLE"); testConformance(rbUCA); } }
void UCAConformanceTest::TestRulesShifted(/* par */) { logln("This test is currently disabled, as it is impossible to " "wholly represent fractional UCA using tailoring rules."); return; initRbUCA(); if(U_SUCCESS(status)) { setCollShifted(rbUCA); openTestFile("SHIFTED"); testConformance(rbUCA); } }
TEST_F(SignConversionTest, Int16) { AFfilehandle file = createTestFile(16); const int16_t data[] = { kMinInt16, 0, kMaxInt16 }; const int frameCount = sizeof (data) / sizeof (data[0]); AFframecount framesWritten = afWriteFrames(file, AF_DEFAULT_TRACK, data, frameCount); ASSERT_EQ(framesWritten, frameCount); afCloseFile(file); file = openTestFile(16); ASSERT_TRUE(file != NULL); uint16_t readData[frameCount]; AFframecount framesRead = afReadFrames(file, AF_DEFAULT_TRACK, readData, frameCount); ASSERT_EQ(framesRead, frameCount); afCloseFile(file); const uint16_t expectedData[] = { 0, -kMinInt16, kMaxUInt16 }; for (int i=0; i<frameCount; i++) EXPECT_EQ(readData[i], expectedData[i]); }
TEST_F(PCMMappingTest, Double) { AFfilehandle file = createTestFile(AF_SAMPFMT_DOUBLE, 64); const double data[] = { -1, 0, 1 }; const int frameCount = sizeof (data) / sizeof (data[0]); AFframecount framesWritten = afWriteFrames(file, AF_DEFAULT_TRACK, data, frameCount); ASSERT_EQ(framesWritten, frameCount); afCloseFile(file); file = openTestFile(); ASSERT_TRUE(file != NULL); double slope = 2, intercept = 2, minClip = 0, maxClip = 4; afSetVirtualPCMMapping(file, AF_DEFAULT_TRACK, slope, intercept, minClip, maxClip); double readData[frameCount]; AFframecount framesRead = afReadFrames(file, AF_DEFAULT_TRACK, readData, frameCount); ASSERT_EQ(framesRead, frameCount); afCloseFile(file); const double expectedData[] = { 0, 2, 4 }; for (int i=0; i<frameCount; i++) EXPECT_EQ(readData[i], expectedData[i]); }
void UCAConformanceTest::TestTableShifted(/* par */) { setCollShifted(UCA); openTestFile("SHIFTED"); testConformance(UCA); }
void UCAConformanceTest::TestTableNonIgnorable(/* par */) { setCollNonIgnorable(UCA); openTestFile("NON_IGNORABLE"); testConformance(UCA); }