Skip to content

Commit

Permalink
All kernel functions have now their own stubs!
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca1991 committed Dec 29, 2017
1 parent 68cbd15 commit bbe8351
Show file tree
Hide file tree
Showing 59 changed files with 2,572 additions and 22 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# xbox kernel test suite
Xbox kernel APIs tester written using the opensoure nxdk

This is a tool for testing xbox kernel apis, written to test CxBx-Reloaded kernel implementation.
This is a tool for testing xbox kernel apis, in particular CxBx-Reloaded kernel implementation.

THIS IS EXTREMELY WIP AND SHOULD NOT BE USED NOW. THE SOURCE CODE WILL BE REORGANIZED SOON.
# HOW TO BUILD:
All you need is nxdk. You can get it here: https://github.com/xqemu/nxdk
Here is a setup guide: https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/wiki/Installing-the-nxdk

# USEFUL LINKS:
* https://github.com/wine-mirror/wine/tree/master/dlls/ntdll/tests
* https://github.com/wine-mirror/wine/tree/master/dlls/kernel32/tests
* https://github.com/mirror/reactos/tree/master/rostests/apitests/kernel32
* https://github.com/mborgerson/xbtests?files=1

# TODO:
* Add configuration file support
* Fix the "print" wrapper function to display output on real Xbox
* Reorganize source code (with folders etc)
* Complete the test suite with all xbox kernel APIs
* Add configuration file support (almost done - WIP)
* Complete the test suite with all xbox kernel APIs (fill the stubs)

ANY HELP IS REALLY WELCOME!
15 changes: 15 additions & 0 deletions av_tests.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
#include <pbkit/pbkit.h>
#include "global.h"
#include "output.h"


void test_AvGetSavedDataAddress(){
if(is_real_hw){
print("0x0001 - AvGetSavedDataAddress: Skipped (due to real hadrware) / value: %x",AvGetSavedDataAddress());
return;
}
AvSetSavedDataAddress((void*) 0x12345678);
AvGetSavedDataAddress()==(void*)0x12345678 ? print("0x0001 - AvGetSavedDataAddress: Good") : print("0x0001 - AvGetSavedDataAddress: Faulty");
}

void test_AvSendTVEncoderOption(){
/* FIXME: there are other functions such as AV_OPTION_QUERY_MODE, AV_QUERY_ENCODER_TYPE, AV_OPTION_WIDESCREEN etc*/
unsigned long res = 0;
AvSendTVEncoderOption(NULL, 6, 0, &res);
print("0x0002 - AvSendTVEncoderOption: %d (0=AV_PACK_NONE 1=AV_PACK_STANDARD 2=AV_PACK_RFU 3=AV_PACK_SCART 4=AV_PACK_HDTV 5=AV_PACK_VGA 6=AV_PACK_SVIDEO)", res);
}

void test_AvSetDisplayMode(){
if(is_real_hw){
print("0x0003 - AvSetDisplayMode: Skipped (due to real hadrware)");
return;
}
AvSetDisplayMode(NULL, 0, 0, 0, 0, 0) == 0L ? print("0x0003 - AvSetDisplayMode: 0 (Good)") : print("0x0003 - AvSetDisplayMode: !=0 (Faulty)");
}

void test_AvSetSavedDataAddress(){
if(is_real_hw){
print("0x0004 - AvSetSavedDataAddress: Skipped (due to real hadrware)");
return;
}
AvSetSavedDataAddress((void*) 0x12345678);
AvGetSavedDataAddress()==(void*)0x12345678 ? print("0x0004 - AvSetSavedDataAddress: Good") : print("0x0004 - AvSetSavedDataAddress: Faulty");
}
23 changes: 23 additions & 0 deletions dbg_tests.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
void test_DbgBreakPoint(){
/* FIXME: This is a stub! implement this function! */
}

void test_DbgBreakPointWithStatus(){
/* FIXME: This is a stub! implement this function! */
}

void test_DbgLoadImageSymbols(){
/* FIXME: This is a stub! implement this function! */
}

void test_DbgPrint(){
/* FIXME: This is a stub! implement this function! */
}

void test_DbgPrompt(){
/* FIXME: This is a stub! implement this function! */
}

void test_DbgUnLoadImageSymbols(){
/* FIXME: This is a stub! implement this function! */
}
11 changes: 11 additions & 0 deletions dbg_tests.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef DBG_TESTS_H
#define DBG_TESTS_H

void test_DbgBreakPoint();
void test_DbgBreakPointWithStatus();
void test_DbgLoadImageSymbols();
void test_DbgPrint();
void test_DbgPrompt();
void test_DbgUnLoadImageSymbols();

#endif
91 changes: 91 additions & 0 deletions ex_tests.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
void test_ExAcquireReadWriteLockExclusive(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExAcquireReadWriteLockShared(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExAllocatePool(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExAllocatePoolWithTag(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExEventObjectType(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExFreePool(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExInitializeReadWriteLock(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExInterlockedAddLargeInteger(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExInterlockedAddLargeStatistic(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExInterlockedCompareExchange64(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExMutantObjectType(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExQueryPoolBlockSize(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExQueryNonVolatileSetting(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExReadWriteRefurbInfo(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExRaiseException(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExRaiseStatus(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExReleaseReadWriteLock(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExSaveNonVolatileSetting(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExSemaphoreObjectType(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExTimerObjectType(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExfInterlockedInsertHeadList(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExfInterlockedInsertTailList(){
/* FIXME: This is a stub! implement this function! */
}

void test_ExfInterlockedRemoveHeadList(){
/* FIXME: This is a stub! implement this function! */
}
28 changes: 28 additions & 0 deletions ex_tests.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef EX_TESTS_H
#define EX_TESTS_H

void test_ExAcquireReadWriteLockExclusive();
void test_ExAcquireReadWriteLockShared();
void test_ExAllocatePool();
void test_ExAllocatePoolWithTag();
void test_ExEventObjectType();
void test_ExFreePool();
void test_ExInitializeReadWriteLock();
void test_ExInterlockedAddLargeInteger();
void test_ExInterlockedAddLargeStatistic();
void test_ExInterlockedCompareExchange64();
void test_ExMutantObjectType();
void test_ExQueryPoolBlockSize();
void test_ExQueryNonVolatileSetting();
void test_ExReadWriteRefurbInfo();
void test_ExRaiseException();
void test_ExRaiseStatus();
void test_ExReleaseReadWriteLock();
void test_ExSaveNonVolatileSetting();
void test_ExSemaphoreObjectType();
void test_ExTimerObjectType();
void test_ExfInterlockedInsertHeadList();
void test_ExfInterlockedInsertTailList();
void test_ExfInterlockedRemoveHeadList();

#endif
11 changes: 11 additions & 0 deletions fsc_tests.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
void test_FscGetCacheSize(){
/* FIXME: This is a stub! implement this function! */
}

void test_FscInvalidateIdleBlocks(){
/* FIXME: This is a stub! implement this function! */
}

void test_FscSetCacheSize(){
/* FIXME: This is a stub! implement this function! */
}
9 changes: 9 additions & 0 deletions fsc_tests.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef FSC_TESTS_H
#define FSC_TESTS_H

void test_FscGetCacheSize();
void test_FscInvalidateIdleBlocks();
void test_FscSetCacheSize();


#endif
Loading

0 comments on commit bbe8351

Please sign in to comment.