Home | History | Annotate | Download | only in test
      1 #include "shared.rsh"
      2 
      3 // Testing primitive types
      4 float floatTest = 1.99f;
      5 double doubleTest = 2.05;
      6 char charTest = -8;
      7 short shortTest = -16;
      8 int intTest = -32;
      9 long longTest = 17179869184l; // 1 << 34
     10 long long longlongTest = 68719476736l; // 1 << 36
     11 
     12 uchar ucharTest = 8;
     13 ushort ushortTest = 16;
     14 uint uintTest = 32;
     15 ulong ulongTest = 4611686018427387904L;
     16 int64_t int64_tTest = -17179869184l; // - 1 << 34
     17 uint64_t uint64_tTest = 117179869184l;
     18 
     19 static 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 
     43 void 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