bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. if path in PRUNE_PATHS: dirs[:] = [] continue # Prune out directories we want to skip. # (Note that we loop ove...
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] # Pretty up the path. if path in PRUNE_PATHS: dirs[:] = [] continue # Prune out directories we want to skip. # (Note that we loop ove...
476,000
def InitFunction(self, func): """Add or adjust anything type specific for this function.""" if func.GetInfo('needs_size'): func.AddCmdArg(Argument('data_size', 'uint32'))
def InitFunction(self, func): """Add or adjust anything type specific for this function.""" if func.GetInfo('needs_size'): func.AddCmdArg(Argument('data_size', 'uint32'))
476,001
typedef %(name)s::Result Result;
typedef %(name)s::Result Result;
476,002
def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" const int kSomeBaseValueToTestWith = 51;\n") file.Write(" static %s data[] = {\n" % func.info.data_type) for v in range(0, func.info.count * 2): file.Write(" stati...
def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" const int kSomeBaseValueToTestWith = 51;\n") file.Write(" static %s data[] = {\n" % func.info.data_type) for v in range(0, func.info.count * 2): file.Write(" stati...
476,003
def __init__(self): TypeHandler.__init__(self)
def __init__(self): TypeHandler.__init__(self)
476,004
def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" init_code = [] check_code = [] all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: init_code.append(" static_cast<%s>(%d)," % (arg.type, value)) value += 1 value = 11 for arg in all_but_last_arg: check_...
def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" init_code = [] check_code = [] all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: init_code.append(" static_cast<%s>(%d)," % (arg.type, value)) value += 1 value = 11 for arg in all_but_last_arg: check_...
476,005
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_a...
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_a...
476,006
def __init__(self, verbose): self.original_functions = [] self.functions = [] self.verbose = verbose self.errors = 0 self._function_info = {} self._empty_type_handler = TypeHandler() self._empty_function_info = FunctionInfo({}, self._empty_type_handler)
def __init__(self, verbose): self.original_functions = [] self.functions = [] self.verbose = verbose self.errors = 0 self._function_info = {} self._empty_type_handler = TypeHandler() self._empty_function_info = FunctionInfo({}, self._empty_type_handler)
476,007
def WriteCommandIds(self, filename): """Writes the command buffer format""" file = CHeaderWriter(filename) file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") for func in self.functions: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) file.Write(" %-60s /* %d */ \\\n" % ("OP(...
def WriteCommandIds(self, filename): """Writes the command buffer format""" file = CHeaderWriter(filename) file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") for func in self.functions: if not func.name in _CMD_ID_TABLE: self.Error("Command %s not in _CMD_ID_TABLE" % func.name) file.Write(" %-60s /* %d */ \\\n" % ("OP(...
476,008
def Analyze(self, check_sanity=False): if self._options.indirect: return self.GetAnalyzeResultsIndirect() filenames = glob.glob(self.TMP_DIR + "/tsan.*") use_gdb = common.IsMac() analyzer = tsan_analyze.TsanAnalyze(self._source_dir, filenames, use_gdb=use_gdb) ret = analyzer.Report(check_sanity) if ret != 0: logging.in...
def Analyze(self, check_sanity=False): filenames = glob.glob(self.TMP_DIR + "/tsan.*") use_gdb = common.IsMac() analyzer = tsan_analyze.TsanAnalyze(self._source_dir, filenames, use_gdb=use_gdb) ret = analyzer.Report(check_sanity) if ret != 0: logging.info("Please see http://dev.chromium.org/developers/how-tos/" "using-...
476,009
def AddBucketFunction(self, generator, func): """Adds a bucket version of a function.""" # Generate an immediate command if there is only 1 pointer arg. bucket = func.GetInfo('bucket') # can be True, False or None if bucket: generator.AddFunction(BucketFunction(func))
defAddBucketFunction(self,generator,func):"""Addsabucketversionofafunction."""#Generateanimmediatecommandifthereisonly1pointerarg.bucket=func.GetInfo('bucket')#canbeTrue,FalseorNoneifbucket:generator.AddFunction(BucketFunction(func))
476,010
def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), 'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', ] for url in urls: self.NavigateToURL(...
def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), self.GetFileURLForPath('another_non-existing_path'), ] for url in urls: self.NavigateToURL(url) self.assertEqu...
476,011
def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), 'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', ] for url in urls: self.NavigateToURL(...
def testInvalidURLNoHistory(self): """Invalid URLs should not go in history.""" assert not self.GetHistoryInfo().History(), 'Expecting clean history.' urls = [ self.GetFileURLForPath('some_non-existing_path'), 'http://a.nonexisting.domain.blah', 'ftp://this.should.not.exist/file', ] for url in urls: if not url.startswi...
476,012
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
476,013
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): pr...
476,014
def ReadSuppressions(lines, supp_descriptor): """Given a list of lines, returns a list of suppressions. Args: lines: a list of lines containing suppressions. supp_descriptor: should typically be a filename. Used only when parsing errors happen. """ result = [] cur_descr = '' cur_type = '' cur_stack = [] in_suppression...
def ReadSuppressions(lines, supp_descriptor): """Given a list of lines, returns a list of suppressions. Args: lines: a list of lines containing suppressions. supp_descriptor: should typically be a filename. Used only when parsing errors happen. """ result = [] cur_descr = '' cur_type = '' cur_stack = [] in_suppression...
476,015
def GetMIMETypeFromName(self, file_name): """Returns the mime type for the specified file_name. So far it only looks at the file extension."""
def GetMIMETypeFromName(self, file_name): """Returns the mime type for the specified file_name. So far it only looks at the file extension."""
476,016
def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input f...
def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input f...
476,017
def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input f...
def Main(): """Zip input arguments to Zip output archive.""" (options, args) = ParseCommandLine() # Test that all the input files exist before we blow the output archive away # only to fail part way. for path in args: if path == _DEBUG_ONLY_FILE_SEPARATOR: continue if not os.path.exists(path): raise Exception('Input f...
476,018
def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return
def _ConvertJSONToCurrentVersion(self, results_json): """If the JSON does not match the current version, converts it to the current version and adds in the new version number. """ if (self.VERSION_KEY in results_json and results_json[self.VERSION_KEY] == self.VERSION): return
476,019
def Create(self, tool_name): if tool_name == "memcheck": return Memcheck() if tool_name == "memcheck_wine": return Memcheck() if tool_name == "tsan": if not IsLinux(): logging.info("WARNING: ThreadSanitizer may be unstable on Mac.") logging.info("See http://code.google.com/p/data-race-test/wiki/" "ThreadSanitizerOnMacO...
def Create(self, tool_name): if tool_name == "memcheck": return Memcheck() if tool_name == "memcheck_wine": return Memcheck() if tool_name == "tsan": if not common.IsLinux(): logging.info("WARNING: ThreadSanitizer may be unstable on Mac.") logging.info("See http://code.google.com/p/data-race-test/wiki/" "ThreadSanitize...
476,020
def _parse_source_files(self): """ Returns a list of paths to source files present in the extenion.
def _parse_source_files(self): """ Returns a list of paths to source files present in the extenion.
476,021
def Close(self): self.Write("#endif // %s\n\n" % self.guard) CWriter.Close(self)
def Close(self): self.Write("#endif // %s\n\n" % self.guard) CWriter.Close(self)
476,022
def WriteValidUnitTest(self, func, file, test, extra = {}): """Writes a valid unit test.""" if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) name = func.name arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): arg_strings.append(arg.GetValidArg(count, 0)) count += 1 gl...
def WriteValidUnitTest(self, func, file, test, extra = {}): """Writes a valid unit test.""" name = func.name arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): arg_strings.append(arg.GetValidArg(count, 0)) count += 1 gl_arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): gl_arg_strings.append(arg.G...
476,023
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues(func) for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" gl_error = None count = 0 for ar...
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" gl_error = None count = 0 for arg in...
476,024
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
476,025
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
def WriteGLES2ImplementationDeclaration(self, func, file): """Writes the GLES2 Implemention declaration.""" file.Write("%s %s(%s);\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write("\n")
476,026
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in fu...
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" ...
476,027
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in fu...
def WriteGLES2ImplementationHeader(self, func, file): """Writes the GLES2 Implemention.""" impl_func = func.GetInfo('impl_func') if func.can_auto_generate and (impl_func == None or impl_func == True): file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) for arg in fu...
476,028
def InitFunction(self, func): """Overrriden from TypeHandler.""" func.AddCmdArg(Argument("result_shm_id", 'uint32')) func.AddCmdArg(Argument("result_shm_offset", 'uint32')) if func.GetInfo('result') == None: func.AddInfo('result', ['uint32'])
def InitFunction(self, func): """Overrriden from TypeHandler.""" func.AddCmdArg(Argument("result_shm_id", 'uint32')) func.AddCmdArg(Argument("result_shm_offset", 'uint32')) if func.GetInfo('result') == None: func.AddInfo('result', ['uint32'])
476,029
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" ...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" ...
476,030
def InitFunction(self, func): """Overrriden from TypeHandler.""" # remove all but the first cmd args. cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) # add on a bucket id. func.AddCmdArg(Argument('bucket_id', 'uint32'))
def InitFunction(self, func): """Overrriden from TypeHandler.""" # remove all but the first cmd args. cmd_args = func.GetCmdArgs() func.ClearCmdArgs() func.AddCmdArg(cmd_args[0]) # add on a bucket id. func.AddCmdArg(Argument('bucket_id', 'uint32'))
476,031
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(func_name)s(%(args)s) {
476,032
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,033
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() all_but_last_2_args = args[:-2] for arg in all_but_l...
476,034
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode...
476,035
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" return 0
def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" return 0
476,036
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
476,037
def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self
def GetImmediateVersion(self): """Gets the immediate version of this argument.""" return self
476,038
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
def GetNumInvalidValues(self): """overridden from Argument.""" if func.is_immediate: return 0 return 1
476,039
def GetNumInvalidValues(self, func): """overridden from Argument.""" if func.is_immediate: return 0 return 1
def GetNumInvalidValues(self, func): """overridden from Argument.""" return 1
476,040
def GetInvalidArg(self, offset, index): """overridden from Argument.""" return ("-1", "kNoError", "GL_INVALID_VALUE")
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("-1", "kNoError", "GL_INVALID_VALUE")
476,041
def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
def WriteValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return error::kNoError;\n") file.Write(" }\n")
476,042
def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n")
def WriteClientSideValidationCode(self, file): """overridden from Argument.""" file.Write(" if (%s < 0) {\n" % self.name) file.Write(" SetGLError(GL_INVALID_VALUE);\n") file.Write(" return;\n") file.Write(" }\n")
476,043
def GetNumInvalidValues(self, func): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0
def GetNumInvalidValues(self): """returns the number of invalid values to be tested.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] return len(invalid) return 0
476,044
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_...
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", self.gl_error) return ("---ERROR1---", "kNoError", self.gl_...
476,045
def GetNumInvalidValues(self, func): """Overridden from Argument.""" return 2
def GetNumInvalidValues(self): """Overridden from Argument.""" return 2
476,046
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_a...
def __init__(self, original_name, name, info, return_type, original_args, args_for_cmds, cmd_args, init_args, num_pointer_args): self.name = name self.original_name = original_name self.info = info self.type_handler = info.type_handler self.return_type = return_type self.original_args = original_args self.num_pointer_a...
476,047
def GetInfo(self, name): """Returns a value from the function info for this function.""" if hasattr(self.info, name): return getattr(self.info, name) return None
def GetInfo(self, name): """Returns a value from the function info for this function.""" if hasattr(self.info, name): return getattr(self.info, name) return None
476,048
def GetCmdArgs(self): """Gets the command args for this function.""" return self.cmd_args
def GetCmdArgs(self): """Gets the command args for this function.""" return self.cmd_args
476,049
def __init__(self, func): new_args = [] for arg in func.GetOriginalArgs(): new_arg = arg.GetImmediateVersion() if new_arg: new_args.append(new_arg)
def __init__(self, func): new_args = [] for arg in func.GetOriginalArgs(): new_arg = arg.GetImmediateVersion() if new_arg: new_args.append(new_arg)
476,050
def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser)
def __init__(self): super(ValgrindTool, self).__init__() self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser)
476,051
def __init__(self): ValgrindTool.__init__(self) self.RegisterOptionParserHook(Memcheck.ExtendOptionParser)
def __init__(self): super(Memcheck, self).__init__() self.RegisterOptionParserHook(Memcheck.ExtendOptionParser)
476,052
def __init__(self): BaseTool.__init__(self)
def __init__(self): BaseTool.__init__(self)
476,053
def __init__(self): ValgrindTool.__init__(self) ThreadSanitizerBase.__init__(self)
def __init__(self): ValgrindTool.__init__(self) ThreadSanitizerBase.__init__(self)
476,054
def __init__(self): PinTool.__init__(self) ThreadSanitizerBase.__init__(self) self.RegisterOptionParserHook(ThreadSanitizerWindows.ExtendOptionParser)
def __init__(self): super(ThreadSanitizerWindows, self).__init__() self.RegisterOptionParserHook(ThreadSanitizerWindows.ExtendOptionParser)
476,055
def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(DrMemory.ExtendOptionParser)
def __init__(self): super(DrMemory, self).__init__() self.RegisterOptionParserHook(DrMemory.ExtendOptionParser)
476,056
def ToolSpecificFlags(self): proc = super(ThreadSanitizerRV2Mixin, self).ToolSpecificFlags() proc += ['--race-verifier=' + self.TMP_DIR + '/race.log'] return proc
def ToolSpecificFlags(self): proc = super(ThreadSanitizerRV2Mixin, self).ToolSpecificFlags() proc += ['--race-verifier=' + self.TMP_DIR + '/race.log', '--race-verifier-sleep-ms=%d' % int(self._options.race_verifier_sleep_ms)] return proc
476,057
def Report(self, files, check_sanity=False): '''Reads in a set of files and prints Memcheck report.
def Report(self, files, check_sanity=False): '''Reads in a set of files and prints Memcheck report.
476,058
def EndParsing(self): super(type(self), self).EndParsing()
def EndParsing(self): super(type(self), self).EndParsing()
476,059
def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', 'cygwin': 'win', } swig_bin = os.path.join(swig_dir, dir...
def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', } platform_flags = { 'darwin': '-DSWIGMAC', 'linux2': ...
476,060
def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', 'cygwin': 'win', } swig_bin = os.path.join(swig_dir, dir...
def main(): swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, 'third_party', 'swig')) lib_dir = os.path.join(swig_dir, "Lib") os.putenv("SWIG_LIB", lib_dir) dir_map = { 'darwin': 'mac', 'linux2': 'linux', 'win32': 'win', 'cygwin': 'win', } swig_bin = os.path.join(swig_dir, dir...
476,061
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete tit...
def _CheckBookmarkResultForVariousInputs(self, url, title, windex=0): """Check if we get the Bookmark for complete and partial inputs.""" # Check if the complete URL would get the bookmark url_matches = self._GetOmniboxMatchesFor(url, windex=windex) self._VerifyHasBookmarkResult(url_matches) # Check if the complete tit...
476,062
def Start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.IsRunning(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
def Start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.IsRunning(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
476,063
def Stop(self, force=False): if not force and not self.IsRunning(): return
def Stop(self, force=False): if not force and not self.IsRunning(): return
476,064
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
476,065
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
def start(self): if not self._web_socket_tests: logging.info('No need to start %s server.' % self._server_name) return if self.is_running(): raise PyWebSocketNotStarted('%s is already running.' % self._server_name)
476,066
def stop(self, force=False): if not force and not self.is_running(): return
def stop(self, force=False): if not force and not self.is_running(): return
476,067
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) {
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" code = """%(return_type)s %(name)s(%(typed_args)s) {
476,068
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" %s_id_handler_->FreeIds(%s);\n...
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_decl = func.GetInfo('impl_decl') if impl_decl == None or impl_decl == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" %s_id_handler_->FreeIds(%s);\n...
476,069
code = """ typedef %(func_name)s::Result Result;
code = """ typedef %(func_name)s::Result Result;
476,070
typedef %(name)s::Result Result;
typedef %(name)s::Result Result;
476,071
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" count = 0 for arg in func.GetOrigina...
def WriteInvalidUnitTest(self, func, file, test, extra = {}): """Writes a invalid unit test.""" arg_index = 0 for arg in func.GetOriginalArgs(): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] parse_result = "kNoError" count = 0 for arg in func.GetOrigina...
476,072
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
476,073
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,074
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
476,075
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
def WriteImmediateServiceUnitTest(self, func, file): """Writes the service unit test for a command.""" valid_test = """
476,076
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
def WriteServiceUnitTest(self, func, file): """Overrriden from TypeHandler.""" valid_test = """
476,077
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("---ERROR0---", "---ERROR2---")
def GetInvalidArg(self, offset, index): """returns an invalid value and expected parse result by index.""" return ("---ERROR0---", "---ERROR2---")
476,078
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
def WriteValidationCode(self, file): """Writes the validation code for an argument.""" pass
476,079
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError") return ("---ERROR1---", "kNoError")
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError") return ("---ERROR1---", "kNoError")
476,080
def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds")
def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds", None) else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds")
476,081
def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds")
def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: return ("kInvalidSharedMemoryId, 0", "kOutOfBounds", None) else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", "kOutOfBounds")
476,082
def _GetDangerousDownload(self): """Returns the file url for a dangerous download for this OS.""" sub_path = os.path.join(self.DataDir(), 'downloads', 'dangerous') if self.IsMac(): return os.path.join(sub_path, 'dangerous.dmg') return os.path.join(sub_path, 'dangerous.exe')
def _GetDangerousDownload(self): """Returns the file url for a dangerous download for this OS.""" sub_path = os.path.join(self.DataDir(), 'downloads', 'dangerous') if self.IsMac(): return os.path.join(sub_path, 'invalid-dummy.dmg') return os.path.join(sub_path, 'dangerous.exe')
476,083
def correct_semantic_case(name): lower_name = name.lower() for current_name in MATRIX_UNIFORM_NAMES: if lower_name == current_name.lower(): return current_name return lower_name
def correct_semantic_case(name): lower_name = name.lower() return MATRIX_UNIFORM_NAMES_MAPPING.get(lower_name, lower_name)
476,084
def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%...
def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%...
476,085
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
def _Run(self): """Run the tests.""" if self._options.wait_for_debugger: raw_input('Attach debugger to process %s and hit <enter> ' % os.getpid())
476,086
def find_o3d_root(): path = os.path.abspath(sys.path[0]) for i in range(0, 5): path = os.path.dirname(path) if (os.path.isdir(os.path.join(path, 'o3d')) and os.path.isdir(os.path.join(path, 'third_party'))): return path return ''
def find_o3d_root(): path = os.path.abspath(sys.path[0]) for i in range(5): path = os.path.dirname(path) if (os.path.isdir(os.path.join(path, 'o3d')) and os.path.isdir(os.path.join(path, 'third_party'))): return path return ''
476,087
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
def default_cgc(): paths = ['/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe'] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match #...
476,088
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
476,089
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
476,090
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match...
476,091
def check_cgc(CGC): if not os.path.exists(CGC): print >>sys.stderr, CGC+' is not found, use --cgc option to specify its' print >>sys.stderr, 'location. You may need to install nvidia cg toolkit.' sys.exit(1)
def check_cgc(cgc_path): if not os.path.exists(cgc_path): print >>sys.stderr, (cgc_path + ' is not found, use --cgc option to specify its') print >>sys.stderr, 'location. You may need to install nvidia cg toolkit.' sys.exit(1)
476,092
def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) gl...
def cg_to_glsl(cg_shader, cgc_path): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIP...
476,093
def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) gl...
def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([cgc_path]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIP...
476,094
def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) gl...
def cg_to_glsl(cg_shader, CGC): cg_shader = cg_rename_attributes(cg_shader) vertex_entry = re.search(r'#o3d\s+VertexShaderEntryPoint\s+(\w+)', cg_shader).group(1) p = subprocess.Popen([CGC]+('-profile glslv -entry %s' % vertex_entry).split(' '), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) gl...
476,095
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, cgc_path): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,096
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, cgc_path) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,097
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,098
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
def main(cg_shader, CGC): matrixloadorder = get_matrixloadorder(cg_shader) glsl_vertex, glsl_fragment, log = cg_to_glsl(cg_shader, CGC) print log print fix_glsl(glsl_vertex) print print '// #o3d SplitMarker' print get_matrixloadorder(cg_shader).strip() print print fix_glsl(glsl_fragment)
476,099