20 Commits

Author SHA1 Message Date
Allan Odgaard
b514114ec7 Access most system singletons using dot syntax
These are identified by having a prefix of shared, default, or standard in the class method.
2020-04-23 12:25:11 +07:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Allan Odgaard
46fb745bbe Use perrorf when printing errors with dynamic strings
Also revise error messages to be more consistent.
2016-08-28 17:25:26 +02:00
Allan Odgaard
dbdfa3c6af Add identifying information to perror output 2016-08-21 12:09:30 +02:00
Allan Odgaard
7cb2330aae Log error if curl_easy_init() or accept() fails 2014-09-30 14:15:11 +02:00
Allan Odgaard
ec81a045af Force a layout before opening window (from tests)
This appears to be a requirement (to do it manually). Running 10.9.4.
2014-09-17 10:35:25 +02:00
Allan Odgaard
69c83e56df The ‘const’ keyword should be to the right of its type
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.

E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
2014-03-31 08:27:19 +07:00
Allan Odgaard
2c20ab23b0 Ask for maximum queue length for pending socket connections
This is mainly because the SOMAXCONN constant looks better (in the source) than some arbitrarily chosen number. The constant is presently defined as 128 so it doesn’t seem wasteful, and presumably the queue will only take up space if we are not actually responding to socket connections.
2014-03-23 22:47:16 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
1c308c810d Use map::emplace instead of inserting std::pair (C++11) 2013-09-05 20:59:11 +02:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
84dc2dd871 Allow a target to use both new and old test system
Presently the new test system cannot be used for (interactive) GUI tests, so we keep the old one until we have that feature in the new.
2013-08-01 19:01:24 +02:00
Allan Odgaard
d5d01542f7 Support copying test::jail_t 2013-07-25 13:54:25 +02:00
Allan Odgaard
13edc6d131 Use O_CLOEXEC when opening files
This avoids leaking file descriptors into child processes, which would otherwise happen if another thread forks while the file descriptor is open.
2013-03-10 16:07:10 +01:00
Allan Odgaard
090a6ac698 Increase queue size for test (web) server
With concurrent tests and sequential handling of requests, the queue size is likely to grow to “number of concurrent tests”.
2013-03-10 16:07:10 +01:00
Allan Odgaard
eb893105e4 Disallow copying test::jail_t
Since we delete the jailed directory in the destructor we can’t support a deep copy of this type. Since we don’t need it, and it’s just a type used in tests, I opted for simply disabling this (to get a compiler error, should it be attempted) rather than introduce the necessary code to allow shallow copies.
2013-02-25 15:26:41 +01:00
Allan Odgaard
4712515e8b Allow passing a window to OakSetupApplicationWithView
Should rename the function to reflect this new flexibility.
2013-02-04 19:38:31 +01:00
Allan Odgaard
452c0b3889 Make cocoa.h usable with ARC
This means removing a few autoreleases so it’ll leak when building without ARC, but as this is just for a short-lived test, it shouldn’t matter.
2012-09-24 20:58:42 +02:00
Allan Odgaard
0e96a04d76 Remove compatibility checks
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
2012-08-29 16:02:29 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00