1#include "shared.rsh" 2 3// Testing primitive types 4float floatTest = 1.99f; 5double doubleTest = 2.05; 6char charTest = -8; 7short shortTest = -16; 8int intTest = -32; 9long longTest = 17179869184l; // 1 << 34 10long long longlongTest = 68719476736l; // 1 << 36 11 12uchar ucharTest = 8; 13ushort ushortTest = 16; 14uint uintTest = 32; 15ulong ulongTest = 4611686018427387904L; 16int64_t int64_tTest = -17179869184l; // - 1 << 34 17uint64_t uint64_tTest = 117179869184l; 18 19static bool basic_test(uint32_t index) { 20 bool failed = false; 21 22 // This test focuses primarily on compilation-time, not run-time. 23 // For this reason, none of the outputs are actually checked. 24 25 rsDebug("floatTest", floatTest); 26 rsDebug("doubleTest", doubleTest); 27 rsDebug("charTest", charTest); 28 rsDebug("shortTest", shortTest); 29 rsDebug("intTest", intTest); 30 rsDebug("longTest", longTest); 31 rsDebug("longlongTest", longlongTest); 32 33 rsDebug("ucharTest", ucharTest); 34 rsDebug("ushortTest", ushortTest); 35 rsDebug("uintTest", uintTest); 36 rsDebug("ulongTest", ulongTest); 37 rsDebug("int64_tTest", int64_tTest); 38 rsDebug("uint64_tTest", uint64_tTest); 39 40 return failed; 41} 42 43void test_rsdebug(uint32_t index, int test_num) { 44 bool failed = false; 45 failed |= basic_test(index); 46 47 if (failed) { 48 rsSendToClientBlocking(RS_MSG_TEST_FAILED); 49 rsDebug("rsdebug_test FAILED", -1); 50 } 51 else { 52 rsSendToClientBlocking(RS_MSG_TEST_PASSED); 53 rsDebug("rsdebug_test PASSED", 0); 54 } 55} 56 57