def test_substitute_api_with_type_in_brackets(self): self.assertEqual(substitute_specific_keywords('LWSTDAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('LWSTDAPIV_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('PSSTDAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('SHSTDAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('STDAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('STDMETHODIMP_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('URLCACHEAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('WINOLEAPI_(BOOL)'), 'BOOL') self.assertEqual(substitute_specific_keywords('WINOLEAUTAPI_(VOID)'), 'VOID')
def test_swap_optional_annotation_with_previous_word(self): self.assertEqual(substitute_specific_keywords('int pname OPTIONAL'), 'int OPTIONAL pname')
def test_substitute_RPC_VAR_ENTRY_with_cdecl(self): self.assertEqual(substitute_specific_keywords('RPC_VAR_ENTRY'), '__cdecl')
def test_substitute_sec_entry_with_stdcall(self): self.assertEqual(substitute_specific_keywords('SEC_ENTRY'), '__stdcall')
def test_substitute_Z_ARG_function_wrapper(self): self.assertEqual( substitute_specific_keywords('int func Z_ARG((int a, char b));'), 'int func (int a, char b);')
def test_substitute_urlcacheapi_without_underscore_with_dword(self): self.assertEqual(substitute_specific_keywords('URLCACHEAPI'), 'DWORD')
def test_substitute_api_without_underscore_with_hresult(self): self.assertEqual(substitute_specific_keywords('DWMAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('EXPORTAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('INTERNETAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('LWSTDAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('LWSTDAPIV'), 'HRESULT') self.assertEqual(substitute_specific_keywords('PSSTDAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('SHDOCAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('STDAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('SHFOLDERAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('SHSTDAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('STDMETHODIMP'), 'HRESULT') self.assertEqual(substitute_specific_keywords('STRSAFEAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('STRSAFEWORKERAPI'), 'HRESULT') self.assertEqual( substitute_specific_keywords('STRSAFELOCALEWORKERAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('THEMEAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('WINOLEAPI'), 'HRESULT') self.assertEqual(substitute_specific_keywords('WINOLEAUTAPI'), 'HRESULT')
def test_substitute_tdhapi_without_underscore_with_ulong(self): self.assertEqual(substitute_specific_keywords('TDHAPI'), 'ULONG')
def test_substitute_snmpapi_without_underscore_with_int(self): self.assertEqual(substitute_specific_keywords('SNMPAPI'), 'INT')
def test_substitute_pfapientry_without_underscore_with_dword(self): self.assertEqual(substitute_specific_keywords('PFAPIENTRY'), 'DWORD')
def test_substitute_boolapi_without_underscore_with_bool(self): self.assertEqual(substitute_specific_keywords('BOOLAPI'), 'BOOL')
def test_substitute_restrict_keyword(self): self.assertEqual(substitute_specific_keywords('__restrict'), 'restrict')