def test_probes_integration(self): # given source = [ { "api": "system", "is_success_condition": "retval == 0", "args": [{"name": "command", "type": "char *"}], "retval_type": "int", "category": "foobar", }, { "api": "socket", "is_success_condition": "retval > 0", "args": [ {"name": "domain", "type": "int"}, {"name": "type", "type": "double"}, {"name": "protocol", "type": "test_t *"}, ], "retval_type": "size_t", "category": "network", }, ] destination = self.result_file() # when generate_probes(source, destination) # then self.assertEmptyDiff(file_diff(self.reference_file(), destination)) self.assertDtraceCompiles(destination)
def test_probes_one_argument_integer_return_double(self): # given source = self.definitions_file() destination = self.result_file() # when generate_probes(source, destination) # then self.assertTrue( _files_are_equal(self.result_file(), self.reference_file()) )
def test_probes_without_arguments_return_pointer(self): # given source = self.definitions_file() destination = self.result_file() # when generate_probes(source, destination) # then self.assertTrue( _files_are_equal(self.result_file(), self.reference_file()) )
def test_probe_two_arguments_string_int_return_sizet(self): # given source = self.definitions_file() destination = self.result_file() # when generate_probes(source, destination) # then self.assertTrue( _files_are_equal(self.result_file(), self.reference_file()) )
def test_probes_with_native_types(self): # given source = self.definitions_file() destination = self.result_file() # when generate_probes(source, destination) # then self.assertTrue( _files_are_equal(self.result_file(), self.reference_file()) )
def test_probes_integration(self): # given source = [{ "api": "system", "is_success_condition": "retval == 0", "args": [{ "name": "command", "type": "char *" }], "retval_type": "int", "category": "foobar" }, { "api": "socket", "is_success_condition": "retval > 0", "args": [{ "name": "domain", "type": "int" }, { "name": "type", "type": "double" }, { "name": "protocol", "type": "test_t *" }], "retval_type": "size_t", "category": "network" }] destination = self.result_file() # when generate_probes(source, destination) # then self.assertEmptyDiff(file_diff(self.reference_file(), destination)) self.assertDtraceCompiles(destination)