From 877c7481b88331678aaef4167792f6b75b3ac538 Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Thu, 19 Dec 2024 20:40:05 +0000 Subject: [PATCH] [Imp] Improve MPTM read/write tests to include a test tuning and long envelopes with differing sizes. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22583 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- test/test.cpp | 22 ++++++++++++++++------ test/test.mptm | Bin 11900 -> 12271 bytes 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/test/test.cpp b/test/test.cpp index 7805192452c..c8b478ea271 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -3144,7 +3144,10 @@ static void TestLoadMPTMFile(const CSoundFile &sndFile) VERIFY_EQUAL_NONCONT(pIns->wMidiBank, 2); VERIFY_EQUAL_NONCONT(pIns->midiPWD, -1); - VERIFY_EQUAL_NONCONT(pIns->pTuning, nullptr); + if(ins == 1) + VERIFY_EQUAL_NONCONT(pIns->pTuning, nullptr); + else + VERIFY_EQUAL_NONCONT(pIns->pTuning->GetName(), UL_("Test Tuning")); VERIFY_EQUAL_NONCONT(pIns->pitchToTempoLock, TEMPO(130, 2000)); @@ -3163,13 +3166,20 @@ static void TestLoadMPTMFile(const CSoundFile &sndFile) VERIFY_EQUAL_NONCONT(pIns->VolEnv[2].tick, 96); VERIFY_EQUAL_NONCONT(pIns->VolEnv[2].value, 0); - VERIFY_EQUAL_NONCONT(pIns->PanEnv.dwFlags, ENV_LOOP); - VERIFY_EQUAL_NONCONT(pIns->PanEnv.size(), 76); - VERIFY_EQUAL_NONCONT(pIns->PanEnv.nLoopStart, 22); + VERIFY_EQUAL_NONCONT(pIns->PanEnv.dwFlags, ENV_LOOP | ENV_SUSTAIN); + VERIFY_EQUAL_NONCONT(pIns->PanEnv.size(), (ins == 1) ? 74u : 76u); + VERIFY_EQUAL_NONCONT(pIns->PanEnv.nLoopStart, 26); VERIFY_EQUAL_NONCONT(pIns->PanEnv.nLoopEnd, 29); + VERIFY_EQUAL_NONCONT(pIns->PanEnv.nSustainStart, 27); + VERIFY_EQUAL_NONCONT(pIns->PanEnv.nSustainEnd, 28); VERIFY_EQUAL_NONCONT(pIns->PanEnv.nReleaseNode, ENV_RELEASE_NODE_UNSET); - VERIFY_EQUAL_NONCONT(pIns->PanEnv[75].tick, 427); - VERIFY_EQUAL_NONCONT(pIns->PanEnv[75].value, 27); + VERIFY_EQUAL_NONCONT(pIns->PanEnv[73].tick, 417); + VERIFY_EQUAL_NONCONT(pIns->PanEnv[73].value, 23); + if(ins == 2) + { + VERIFY_EQUAL_NONCONT(pIns->PanEnv[75].tick, 427); + VERIFY_EQUAL_NONCONT(pIns->PanEnv[75].value, 27); + } VERIFY_EQUAL_NONCONT(pIns->PitchEnv.dwFlags, ENV_ENABLED | ENV_CARRY | ENV_SUSTAIN | ENV_FILTER); VERIFY_EQUAL_NONCONT(pIns->PitchEnv.size(), 3); diff --git a/test/test.mptm b/test/test.mptm index 593041d9b0608c78ad400c8c66bebbe06d25aa51..ab153f2e5a4d9e1ab2f410da2ef157e743fe157c 100644 GIT binary patch delta 692 zcmewp^FDrp8M7Tr=tRpd#mNc`45rEq4A)f|7}V7m7|Mb8I1r1gGccqAvDm~XE4d~| zrmbP*V_TVv*A8_fVlhRKeazLRfh z2C|ql7%^_P)Z${QzsGQbg;A8@I}cDH5HK1USulk-%X2U=@-PZAc!TtVghN6~^HLRx z3sRFa(=wBxPA>lcAE=zuImF4x#3U%h6QoOsfkA*#m0>p{RHIG^C@6rsfnNOopOJwd zBJN=DRsXcjUzhspHXj6^*z8~U(FQ1CTRVr{_SzbL+Yjavwi2$2wj6h~Y(KM@+P0st zw{2iJ@Sh_z#Lc3Cg~_1BfXQ$R2b0kr4knW$0vtfgjjw4-93a|oBajAZ ziU4YgiGXVAWny9w*0u8u2r-EF5At;P^mFuy_YASoWnkb&axcgaj0`|8vgQ_)1SEsJ zcW-injueor)|m$+rF1hCzyT=8P!0_#CQt~n0o4bm7D6;E(v4-jH%TwqPz2--NJ!)W hT~jcVnaPloWd#@5@Qp03EPN1c&Ze9PnHzN&7yuHT#Z~|S delta 303 zcmaDK|0iaG8S@Qh--(u8imD0>49Ari7&28E7qkSwYR8(PnZ1 zkPMl8089#~Uz2e5Wn>T#(9;V5(hd%KdQQGf3?Ml9iFzKR&*Wf@g)A!=S2Ipd(3mp0 zM>B*;MSAiyO|Qv1TEToq3`UH4jsd|e4B`w744a#^xR_*5F`Qswq>EeRR}WtpX?~@J6TK53n*NwmjNX2>B#}fzk0DiGFm@bk_)Uc Wr^fdK#>VpDwp