MCPcopy Create free account
hub / github.com/crownengine/crown / test_process

Function test_process

src/core/unit_tests.cpp:1860–1881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1858}
1859
1860static void test_process()
1861{
1862#if !CROWN_PLATFORM_EMSCRIPTEN && !CROWN_PLATFORM_WINDOWS
1863 {
1864#define ECHO_TEXT "foobar"
1865 const char *argv[] =
1866 {
1867 "echo"
1868 , ECHO_TEXT
1869 , NULL
1870 };
1871
1872 u32 nbr;
1873 char buf[128] = {0};
1874 Process pr;
1875 ENSURE(pr.spawn(argv, CROWN_PROCESS_STDOUT_PIPE) == 0);
1876 pr.read(&nbr, buf, sizeof(buf));
1877 ENSURE(strcmp(buf, ECHO_TEXT "\n") == 0);
1878 ENSURE(pr.wait() == 0);
1879 }
1880#endif // if !CROWN_PLATFORM_EMSCRIPTEN
1881}
1882
1883static void test_filesystem()
1884{

Callers

nothing calls this directly

Calls 4

strcmpFunction · 0.85
spawnMethod · 0.80
readMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected