source: src/tests/preempt_longrun/processor.c @ 6fb1921

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 6fb1921 was 7bdcac1, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Added the option to make longrun tests run until failure

  • Property mode set to 100644
File size: 566 bytes
Line 
1#include <kernel>
2#include <thread>
3#include <time>
4
5#include <unistd.h>
6
7#include "long_tests.h"
8
9#ifndef PREEMPTION_RATE
10#error PREEMPTION_RATE not defined in makefile
11#endif
12
13Duration default_preemption() {
14        return PREEMPTION_RATE;
15}
16
17static const unsigned long N = 50_000ul;
18
19int main(int argc, char* argv[]) {
20        processor * p[15];
21        for ( int pi = 0; pi < 15; pi++ ) {
22                p[pi] = new();
23        }
24        for ( int i = 0; TEST(i < N); i++) {
25                int pi = i % 15;
26                delete( p[pi] );
27                p[pi] = new();
28                KICK_WATCHDOG;
29        }
30        for ( int pi = 0; pi < 15; pi++ ) {
31                delete( p[pi] );
32        }
33}
Note: See TracBrowser for help on using the repository browser.