MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / CMDTest

Class CMDTest

src/test/test_cmd.cpp:8–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "gtest/gtest.h"
7
8class CMDTest : public testing::Test {
9protected:
10 CMDParser cmdParser;
11 SvmParam &param = cmdParser.param_cmd;
12 static const int max_args = 64;
13 const string traing_file_name = "train_dataset";
14 const string test_file_name = "test_dataset";
15 const string model_file_name = "model";
16 const float float_max_error = 1e-5;
17 int argc;
18 char *argv[max_args];
19
20 void read_cmd(string cmd) {
21 //reset to default
22 argc = 0;
23 param = SvmParam();
24
25 //convert command line to argc and argv
26 char *p2 = strtok(const_cast<char *>(cmd.c_str()), " ");
27 while (p2 && argc < max_args) {
28 argv[argc++] = p2;
29 p2 = strtok(NULL, " ");
30 }
31 //parse command
32 cmdParser.parse_command_line(argc, argv);
33 }
34};
35
36TEST_F(CMDTest, test_default) {
37 read_cmd("thundersvm-train " + traing_file_name);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected