Reduce build graph by another eight percent

This commit is contained in:
Justine Tunney 2022-08-13 13:11:56 -07:00
parent 367d06d9e4
commit 0ea0d33a77
249 changed files with 889 additions and 988 deletions

View file

@ -19,6 +19,7 @@
#include "libc/calls/clock_gettime.internal.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/timespec.h"
#include "libc/calls/struct/timespec.internal.h"
#include "libc/calls/struct/timeval.h"
#include "libc/calls/syscall_support-sysv.internal.h"
#include "libc/dce.h"

View file

@ -19,6 +19,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/iovec.h"
#include "libc/calls/struct/iovec.internal.h"
#include "libc/calls/syscall-sysv.internal.h"
#include "libc/sock/internal.h"
#include "libc/sysv/consts/nr.h"

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/calls/struct/itimerval.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
#include "libc/calls/struct/sigset.h"

View file

@ -19,6 +19,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/iovec.h"
#include "libc/calls/struct/iovec.internal.h"
#include "libc/calls/syscall-sysv.internal.h"
#include "libc/sock/internal.h"
#include "libc/sysv/consts/nr.h"

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/struct/sigset.h"
#include "libc/calls/struct/sigset.internal.h"
#include "libc/intrin/describeflags.internal.h"
#include "libc/sysv/consts/sig.h"
#include "libc/testlib/testlib.h"

View file

@ -1,51 +0,0 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/str/oldutf16.internal.h"
#include "libc/str/str.h"
#include "libc/str/tpdecode.internal.h"
#include "libc/testlib/testlib.h"
TEST(getutf16, testNul) {
wint_t wc;
EXPECT_EQ(1, getutf16(u"", &wc));
EXPECT_EQ('\0', wc);
EXPECT_EQ(1, (getutf16)(u"", &wc));
EXPECT_EQ('\0', wc);
}
TEST(getutf16, testBasic) {
wint_t wc;
EXPECT_EQ(1, getutf16(u"h", &wc));
EXPECT_EQ('h', wc);
EXPECT_EQ(1, (getutf16)(u"h", &wc));
EXPECT_EQ('h', wc);
}
TEST(getutf16, testAegeanNumberSupplementaryPlane) {
wint_t wc;
EXPECT_EQ(4, tpdecode("𐄷", &wc));
EXPECT_EQ(4, tpdecode("\xF0\x90\x84\xB7", &wc));
EXPECT_EQ(0x10137, wc);
EXPECT_EQ(2, strlen16(u"𐄷"));
EXPECT_EQ(2, getutf16(u"𐄷", &wc));
EXPECT_EQ(0x10137, wc);
EXPECT_EQ(2, (getutf16)(u"𐄷", &wc));
EXPECT_EQ(0x10137, wc);
}

View file

@ -1,78 +0,0 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.internal.h"
#include "libc/str/oldutf16.internal.h"
#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
#include "libc/str/unicode.h"
unsigned n;
size_t size;
wchar_t *str;
char16_t *b, *buf;
TEST(pututf16, testEmpty) {
EXPECT_EQ(0, pututf16(NULL, 0, u'j', false));
EXPECT_EQ(0, (pututf16)(NULL, 0, u'j', false));
}
TEST(pututf16, testNul) {
size = 1;
buf = malloc(size * sizeof(char16_t));
EXPECT_EQ(1, pututf16(buf, size, u'\0', false));
EXPECT_EQ(u'\0', buf[0]);
buf[0] = '\7';
EXPECT_EQ(1, (pututf16)(buf, size, u'\0', false));
EXPECT_EQ(u'\0', buf[0]);
free(buf);
}
TEST(pututf16, testAscii) {
size = 1;
buf = malloc(size * sizeof(char16_t));
EXPECT_EQ(1, pututf16(buf, size, u'j', false));
EXPECT_EQ(u'j', buf[0]);
EXPECT_EQ(1, (pututf16)(buf, size, u't', false));
EXPECT_EQ(u't', buf[0]);
free(buf);
}
TEST(pututf16, testGothicSupplementaryPlane) {
size = 2;
buf = malloc(size * sizeof(char16_t));
EXPECT_EQ(2, pututf16(buf, size, L'𐌰', false));
EXPECT_STREQN(u"𐌰", buf, 1);
EXPECT_EQ(2, (pututf16)(buf, size, L'𐌱', false));
EXPECT_STREQN(u"𐌱", buf, 1);
free(buf);
}
TEST(pututf16, testEmojiAndEmojiPresentationModifier_areBothInAstralPlanes) {
n = 8;
b = gc(malloc(sizeof(char16_t) * n));
str = L"\U0001F466\U0001F3FF";
memset(b, 0, n * sizeof(char16_t));
EXPECT_EQ(2, pututf16(b, n, str[0], false));
EXPECT_BINEQ(u"=╪f▄    ", b);
memset(b, 0, n * sizeof(char16_t));
EXPECT_EQ(2, pututf16(b, n, str[1], false));
EXPECT_BINEQ(u"<╪λ▀    ", b);
}

View file

@ -17,14 +17,14 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/intrin/bits.h"
#include "libc/dce.h"
#include "libc/intrin/bits.h"
#include "libc/macros.internal.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/cachesize.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/stdio/rand.h"
#include "libc/runtime/gc.internal.h"
#include "libc/stdio/rand.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/testlib/ezbench.h"
@ -319,13 +319,6 @@ TEST(wcscasecmp, testItWorksCase) {
EXPECT_NE(0, wcscasecmp(L"hello", L"yello"));
}
TEST(strcasecmp8to16, testItWorksCase) {
EXPECT_EQ(0, strcasecmp8to16("hello", u"HELLO"));
EXPECT_EQ(0, strcasecmp8to16("hello", u"Hello"));
EXPECT_EQ(0, strcasecmp8to16("hello", u"hello"));
EXPECT_NE(0, strcasecmp8to16("hello", u"yello"));
}
/*───────────────────────────────────────────────────────────────────────────│─╗
test/libc/str/strcmp_test.c § nontrivial length
*/
@ -607,6 +600,6 @@ BENCH(memcmp, bench) {
EZBENCH2("memcmp big", donothing,
EXPROPRIATE(memcmp(kHyperion, copy, kHyperionSize)));
copy = gc(strdup("tough little ship"));
EZBENCH2("memcmp 19", donothing,
EXPROPRIATE(memcmp("tough little ship", copy, 19)));
EZBENCH2("memcmp 18", donothing,
EXPROPRIATE(memcmp("tough little ship", copy, 18)));
}