2 # Copyright (C) 2008-2010, Parrot Foundation.
7 t/pmc/schedulermessage - test the SchedulerMessage PMC
11 % prove t/pmc/schedulermessage.t
15 Tests the SchedulerMessage PMC.
19 .include 'except_types.pasm'
22 .include 'test_more.pir'
33 new $P0, ['SchedulerMessage']
34 ok(1, 'Instantiated SchedulerMessage PMC')
37 eh = new ['ExceptionHandler']
38 eh.'handle_types'(.EXCEPTION_INVALID_OPERATION)
43 $P0 = new ['SchedulerMessage'], $P1
50 ok($I0, 'initializing with invalid type throws')
53 .sub type_and_id_tests
54 $P0 = new ['SchedulerMessage']
56 $P0 = "some kinda message"
59 is($S0 , "some kinda message", "scheduler message type stored/retrieved successfully")
62 is($I0, 2345, "scheduler id type stored/retrieved successfully")
66 .sub freeze_thaw_tests
67 $P0 = new ['SchedulerMessage']
75 is($S0, "Smart message", "frozen message has correct type")
78 is($I0, 86, "frozen message has correct id")
88 $P1 = new ['SchedulerMessage'], $P0
90 # Make sure the mark vtable function is exercised.
95 is($S0, "nine", "hash-initialized message has correct type")
98 is($I0, 9, "hash-initialized message has correct id")
105 # vim: expandtab shiftwidth=4 ft=pir: