MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

library/cpp/getopt/ut/posix_getopt_ut.cpp:8–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7Y_UNIT_TEST_SUITE(TPosixGetoptTest) {
8 Y_UNIT_TEST(TestSimple) {
9 int argc = 6;
10 const char* argv0[] = {"program", "-b", "-f1", "-f", "2", "zzzz"};
11 char** const argv = (char**)argv0;
12
13 NLastGetopt::optreset = 1;
14 UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt(argc, argv, "bf:"));
15 UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt(argc, argv, "bf:"));
16 UNIT_ASSERT_VALUES_EQUAL(NLastGetopt::optarg, TString("1"));
17 UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt(argc, argv, "bf:"));
18 UNIT_ASSERT_VALUES_EQUAL(NLastGetopt::optarg, TString("2"));
19 UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt(argc, argv, "bf:"));
20
21 UNIT_ASSERT_VALUES_EQUAL(5, NLastGetopt::optind);
22 }
23
24 Y_UNIT_TEST(TestLong) {
25 int daggerset = 0;

Callers

nothing calls this directly

Calls 3

getoptFunction · 0.85
getopt_longFunction · 0.85
getopt_long_onlyFunction · 0.85

Tested by

no test coverage detected