Perform code cleanup on test pledges

This commit is contained in:
Justine Tunney 2022-07-24 22:34:13 -07:00
parent 3d2cf95af1
commit 3443039f34
54 changed files with 112 additions and 83 deletions

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/bits/bits.h"
#include "libc/calls/calls.h"
#include "libc/limits.h"
#include "libc/macros.internal.h"
#include "libc/testlib/testlib.h"
@ -24,6 +25,11 @@
#define ROR(w, k) (CheckUnsigned(w) >> (k) | (w) << (sizeof(w) * 8 - (k)))
#define ROL(w, k) ((w) << (k) | CheckUnsigned(w) >> (sizeof(w) * 8 - (k)))
void SetUpOnce(void) {
pledge("stdio", 0);
errno = 0;
}
TEST(TwosComplementBane, LiteralsThatAreLiterallyTheSameNumber) {
EXPECT_EQ(4, sizeof(INT_MIN));
EXPECT_EQ(8, sizeof(-2147483648));