Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cfnptr committed Jun 7, 2024
1 parent ff769c6 commit d9dfff2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
23 changes: 1 addition & 22 deletions tests/test_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,6 @@ inline static bool testBadValue()

return removeTestFile();
}
inline static bool testBadKeySpacing()
{
if (!createTestFile("someKey :123"))
return false;

ConfReader confReader;
size_t errorLine;

ConfResult confResult = createFileConfReader(
TEST_FILE_NAME, &confReader, &errorLine);

if (confResult != BAD_KEY_CONF_RESULT)
{
printf("testBadKeySpacing: incorrect result. (%s)\n",
confResultToString(confResult));
return false;
}

return removeTestFile();
}
inline static bool testBadValueSpacing()
{
if (!createTestFile("someKey:123"))
Expand Down Expand Up @@ -592,7 +572,6 @@ int main()
result &= testBadComment();
result &= testBadKey();
result &= testBadValue();
result &= testBadKeySpacing();
result &= testBadValueSpacing();
result &= testKey("someKey");
result &= testKey("StartFromBig");
Expand All @@ -603,7 +582,7 @@ int main()
result &= testKey("123456789");
result &= testKey("Numbeeers 2048 ");
result &= testKey(" < thisIsSPACE");
result &= testKey("!@#$%%^&*()_+-{}[]:|\";'\\<>?,./");
result &= testKey("!@#$%%^&*()_+-={}[]|\";'\\<>?,./");
result &= testKey("\t");
result &= testInteger(0, "0");
result &= testInteger(1, "1");
Expand Down
4 changes: 2 additions & 2 deletions tests/test_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ inline static bool compareTestFile(const char* confData)
return false;
}

char* data = malloc(sizeof(char) *(fileSize + 1));
char* data = malloc(sizeof(char) * (fileSize + 1));
if (!data)
{
printf("Failed to allocate read buffer.\n");
Expand Down Expand Up @@ -419,7 +419,7 @@ int main()
result &= testString("\tTab symbol test");
result &= testString("looksLikeKey");
result &= testString("PLEASE DON'T SCREAM");
result &= testString("!@#$%%^&*()_+-{}[]:|\";'\\<>?,./");
result &= testString("!@#$%%^&*()_+-={}[]:|\";'\\<>?,./");
result &= testConfig();
return result ? EXIT_SUCCESS : EXIT_FAILURE;
}

0 comments on commit d9dfff2

Please sign in to comment.