C++: Add a couple more testcases.

This commit is contained in:
Geoffrey White
2021-07-20 17:51:37 +01:00
parent 5d1c7841a6
commit c6d8abc9b1

View File

@@ -331,3 +331,28 @@ void test6_5(const char *path1, const char *path2)
// ...
}
}
// --- open / rename -> chmod ---
void test7_1(const char *path)
{
FILE *f;
f = fopen(path, "wt");
if (f != 0)
{
// ...
fclose(f);
chmod(path, 1234); // BAD [NOT DETECTED]
}
}
void test7_1(const char *path1, const char *path2)
{
if (!rename(path1, path2))
{
chmod(path2, 1234); // BAD [NOT DETECTED]
}
}