about summary refs log tree commit diff stats
path: root/tests/unittests/test_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_common.h')
0 files changed, 0 insertions, 0 deletions
lass='oid'>852936bf ^
6d943605 ^
6d943605 ^



9f78ec2d ^
6d943605 ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
                  








                  
                                        


                                       
 



                                                        
                                            





                                                           
#include<assert.h>
#include<cstdlib>
#include<dirent.h>
#include<vector>
using std::vector;
#include<string>
using std::string;
#include<iostream>
using std::cout;

int main(int argc, const char* argv[]) {
  assert(argc == 3);
  assert(string(argv[1]) == "--until");
  string last_file(argv[2]);

  dirent** files;
  int num_files = scandir(".", &files, NULL, alphasort);
  for (int i = 0; i < num_files; ++i) {
    string curr_file = files[i]->d_name;
    if (!isdigit(curr_file.at(0))) continue;
    if (!last_file.empty() && curr_file > last_file) break;
    cout << curr_file << '\n';
  }
  // don't bother freeing files
  return 0;
}