1/* 2 * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230) 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7/* Force assertions on. */ 8#ifdef NDEBUG 9# undef NDEBUG 10#endif 11 12#include <assert.h> 13#include <camkes.h> 14#include <sys/types.h> 15#include <unistd.h> 16 17static void test_getpid(void) { 18 /* Check that our PID is what we expect. */ 19 pid_t pid = getpid(); 20 assert(pid == 3); 21} 22 23static void test_getppid(void) { 24 /* Check that our parent is the CapDL initialiser. */ 25 pid_t pid = getppid(); 26 assert(pid == 1); 27} 28 29void other_call(void) { 30 test_getpid(); 31 32 test_getppid(); 33} 34