Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for the rescheduling after resuming from suspend when the prio are same. #208

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions tests/threads/threads/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ int testThread(SceSize argc, void *argp) {
}

int testReScheduleThread(SceSize argc, void *argp) {
checkpoint(" - Suspending");
sceKernelSuspendThread(sceKernelGetThreadId());
checkpoint(" - Resumed form suspend and rescheduled");
sceKernelSleepThread();
checkpoint(" - Resumed from suspend and rescheduled");
return 0;
}

Expand Down Expand Up @@ -64,8 +63,21 @@ int main(int argc, char *argv[]) {

checkpointNext("Reschedule after resuming:");
sceKernelStartThread(reScheduleThread, 0, NULL);
sceKernelSuspendThread(reScheduleThread);
checkpoint(" - Suspended");
sceKernelWakeupThread(reScheduleThread);
sceKernelResumeThread(reScheduleThread);
checkpoint("Exit from reSchedule");

reScheduleThread = sceKernelCreateThread("reSchedule test", &testReScheduleThread, 0x20, 0x800, 0, NULL);
checkpointNext("Reschedule after resuming(same priority):");
sceKernelStartThread(reScheduleThread, 0, NULL);
sceKernelDelayThread(1000);
sceKernelSuspendThread(reScheduleThread);
checkpoint(" - Suspended");
sceKernelWakeupThread(reScheduleThread);
sceKernelResumeThread(reScheduleThread);
checkpoint("Exit from reSchedule(same priority)");

return 0;
}
8 changes: 6 additions & 2 deletions tests/threads/threads/suspend.expected
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
[r] Delay: 00000000

[x] Reschedule after resuming:
[x] - Suspending
[x] - Resumed form suspend and rescheduled
[x] - Suspended
[x] - Resumed from suspend and rescheduled
[x] Exit from reSchedule

[x] Reschedule after resuming(same priority):
[r] - Suspended
[x] Exit from reSchedule(same priority)
Binary file modified tests/threads/threads/suspend.prx
Binary file not shown.