Squash commits for public release
This commit is contained in:
5
test/libc/BUILD.gn
Normal file
5
test/libc/BUILD.gn
Normal file
@@ -0,0 +1,5 @@
|
||||
group("test_libc") {
|
||||
deps = [
|
||||
"//test/libc/stdlib:stdlib",
|
||||
]
|
||||
}
|
||||
7
test/libc/stdlib/BUILD.gn
Normal file
7
test/libc/stdlib/BUILD.gn
Normal file
@@ -0,0 +1,7 @@
|
||||
import("//build/test/TEMPLATE.gni")
|
||||
|
||||
group("stdlib") {
|
||||
deps = [
|
||||
"//test/libc/stdlib/tools:tools",
|
||||
]
|
||||
}
|
||||
8
test/libc/stdlib/tools/BUILD.gn
Normal file
8
test/libc/stdlib/tools/BUILD.gn
Normal file
@@ -0,0 +1,8 @@
|
||||
import("//build/test/TEMPLATE.gni")
|
||||
|
||||
xOS_test("tools") {
|
||||
test_bundle = "libc/stdlib/tools"
|
||||
sources = [ "main.c" ]
|
||||
configs = [ "//build/userland:userland_flags" ]
|
||||
deplibs = [ "libc" ]
|
||||
}
|
||||
28
test/libc/stdlib/tools/main.c
Normal file
28
test/libc/stdlib/tools/main.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int values[] = { -52, -1906, -363, -1985, -1407, 213, -25, -1712, -1008, -682, 2101, 639, 2076, 1261, -2009, -1448,
|
||||
1774, 231, -209, 2038, -905, -958, 276, -687, -1789, 1837, -1872, 1243, -16, 603, 1548, -2184, 1972, -1518, 108,
|
||||
-743, 328, 896, -1255, -1312, 897, 1136, 333, 1197, -984, 1453, 1564, 1565, -2208, 1282, 2408, -881, 772, -19,
|
||||
-336, -1273, 1904, -1882, -1165, 1453, 1492, 971, -1758, -1570, -805, 1403, 2015, -2221, -1523, 967, -209, -1055,
|
||||
2418, -344, -1907, 171, -1485, 920, 476, -1327, 204, 27, -1598, -1919, 1363, 448, 339, -1263, 404, 1552, -1699,
|
||||
2118, 1515, -73, -417, -1095, 1933, 1489, 1679, 297 };
|
||||
const int target_values[] = { -2221, -2208, -2184, -2009, -1985, -1919, -1907, -1906, -1882, -1872, -1789, -1758,
|
||||
-1712, -1699, -1598, -1570, -1523, -1518, -1485, -1448, -1407, -1327, -1312, -1273, -1263, -1255, -1165, -1095,
|
||||
-1055, -1008, -984, -958, -905, -881, -805, -743, -687, -682, -417, -363, -344, -336, -209, -209, -73, -52, -25,
|
||||
-19, -16, 27, 108, 171, 204, 213, 231, 276, 297, 328, 333, 339, 404, 448, 476, 603, 639, 772, 896, 897, 920, 967,
|
||||
971, 1136, 1197, 1243, 1261, 1282, 1363, 1403, 1453, 1453, 1489, 1492, 1515, 1548, 1552, 1564, 1565, 1679, 1774,
|
||||
1837, 1904, 1933, 1972, 2015, 2038, 2076, 2101, 2118, 2408, 2418 };
|
||||
|
||||
int cmpfunc(const void* a, const void* b)
|
||||
{
|
||||
return (*(int*)a - *(int*)b);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
qsort(values, sizeof(values) / sizeof(int), sizeof(int), cmpfunc);
|
||||
return memcmp(values, target_values, sizeof(target_values));
|
||||
}
|
||||
Reference in New Issue
Block a user