fix to pass tests

This commit is contained in:
Wengier
2021-11-23 20:02:20 -05:00
parent b77676ed54
commit 796d0befe2
2 changed files with 11 additions and 4 deletions

View File

@@ -222,6 +222,7 @@ void Set_Label(char const * const input, char * const output, bool cdrom) {
togo--;
}
output[labelPos] = 0;
if((labelPos > 0) && (output[labelPos-1] == '.') && labelPos == 9) output[labelPos-1] = 0;
return;
}
@@ -253,8 +254,6 @@ void Set_Label(char const * const input, char * const output, bool cdrom) {
output[labelPos-1] = 0;
}
DOS_Drive::DOS_Drive() {
nocachedir=false;
readonly=false;

View File

@@ -55,8 +55,16 @@ TEST(WildFileCmp, WildDotWild)
TEST(WildFileCmp, WildcardNoExt)
{
bool oldlfn = uselfn;
uselfn = false;
EXPECT_EQ(false, WildFileCmp("TEST.EXE", "*"));
EXPECT_EQ(false, WildFileCmp(".EXE", "*"));
EXPECT_EQ(false, WildFileCmp("TEST.BAK", "T*"));
uselfn = true;
EXPECT_EQ(true, WildFileCmp("TEST.EXE", "*"));
EXPECT_EQ(true, WildFileCmp(".EXE", "*"));
EXPECT_EQ(true, WildFileCmp("TEST.BAK", "T*"));
uselfn = oldlfn;
EXPECT_EQ(true, WildFileCmp("TEST", "*"));
EXPECT_EQ(true, WildFileCmp("TEST", "T*"));
EXPECT_EQ(false, WildFileCmp("TEST", "Z*"));
@@ -80,7 +88,7 @@ TEST(WildFileCmp, QuestionMark)
TEST(Set_Label, Daggerfall)
{
std::string output = run_Set_Label("Daggerfall", false);
EXPECT_EQ("DAGGERFA.LL", output);
EXPECT_EQ("DAGGERFALL", output);
}
TEST(Set_Label, DaggerfallCD)
{
@@ -91,7 +99,7 @@ TEST(Set_Label, DaggerfallCD)
TEST(Set_Label, LongerThan11)
{
std::string output = run_Set_Label("a123456789AAA", false);
EXPECT_EQ("A1234567.89A", output);
EXPECT_EQ("A123456789A", output);
}
TEST(Set_Label, LongerThan11CD)
{