diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/getopt | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_parser.cpp | 2 | ||||
-rw-r--r-- | library/cpp/getopt/small/modchooser.cpp | 2 | ||||
-rw-r--r-- | library/cpp/getopt/small/opt.cpp | 2 | ||||
-rw-r--r-- | library/cpp/getopt/small/opt.h | 2 | ||||
-rw-r--r-- | library/cpp/getopt/small/opt2.cpp | 18 | ||||
-rw-r--r-- | library/cpp/getopt/ut/last_getopt_ut.cpp | 68 | ||||
-rw-r--r-- | library/cpp/getopt/ut/modchooser_ut.cpp | 12 | ||||
-rw-r--r-- | library/cpp/getopt/ut/opt2_ut.cpp | 6 | ||||
-rw-r--r-- | library/cpp/getopt/ut/opt_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/getopt/ut/posix_getopt_ut.cpp | 14 |
10 files changed, 67 insertions, 67 deletions
diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp index 7668b12a03..aec0f97252 100644 --- a/library/cpp/getopt/small/last_getopt_parser.cpp +++ b/library/cpp/getopt/small/last_getopt_parser.cpp @@ -232,7 +232,7 @@ namespace NLastGetopt { Pos_ = pc; bool r = ParseOptArg(Pos_); - Y_ASSERT(r); + Y_ASSERT(r); while (Pos_ == pc) { Y_ASSERT(Sop_ > 0); r = ParseShortOptWithinArg(Pos_, Sop_); diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 2fa5cfd070..91cc88dc22 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -290,7 +290,7 @@ void TModChooser::PrintHelp(const TString& progName) const { } if (ShowSeparated) { - for (const auto& unsortedMode : UnsortedModes) + for (const auto& unsortedMode : UnsortedModes) if (!unsortedMode->Hidden) { if (unsortedMode->Name.size()) { Cerr << " " << unsortedMode->FormatFullName(maxModeLen + 4) << unsortedMode->Description << Endl; diff --git a/library/cpp/getopt/small/opt.cpp b/library/cpp/getopt/small/opt.cpp index 744501765c..9cc4b9c6fe 100644 --- a/library/cpp/getopt/small/opt.cpp +++ b/library/cpp/getopt/small/opt.cpp @@ -88,7 +88,7 @@ int Opt::Get(int* longOptionIndex) { } } -void Opt::DummyHelp(IOutputStream& os) { +void Opt::DummyHelp(IOutputStream& os) { Opts_->PrintUsage(GetProgramName(), os); } diff --git a/library/cpp/getopt/small/opt.h b/library/cpp/getopt/small/opt.h index ecb57439bc..ad057edb67 100644 --- a/library/cpp/getopt/small/opt.h +++ b/library/cpp/getopt/small/opt.h @@ -106,7 +106,7 @@ public: int GetArgC() const; const char** GetArgV() const; - void DummyHelp(IOutputStream& os = Cerr); + void DummyHelp(IOutputStream& os = Cerr); }; // call before getopt. returns non-negative int, removing it from arguments (not found: -1) diff --git a/library/cpp/getopt/small/opt2.cpp b/library/cpp/getopt/small/opt2.cpp index 0cdc774e78..c3316ffe04 100644 --- a/library/cpp/getopt/small/opt2.cpp +++ b/library/cpp/getopt/small/opt2.cpp @@ -272,16 +272,16 @@ int Opt2::AutoUsage(const char* free_arg_names) { fprintf(where, "Usage: %s%s%s%s%s%s%s%s\n", prog, req ? " -" : "", req_str, nreq ? " [-" : "", nreq_str, nreq ? "]" : "", free_arg_names && *free_arg_names ? " " : "", free_arg_names); - for (auto& spec : Specs) { + for (auto& spec : Specs) { const char* hlp = !spec.HelpUsage.empty() ? spec.HelpUsage.data() : spec.HasArg ? "<arg>" : ""; - if (!spec.HasArg || spec.IsRequired) - fprintf(where, " -%c %s\n", spec.opt, hlp); - else if (!spec.IsNumeric) - fprintf(where, " -%c %s [Default: %s]\n", spec.opt, hlp, spec.DefValue); + if (!spec.HasArg || spec.IsRequired) + fprintf(where, " -%c %s\n", spec.opt, hlp); + else if (!spec.IsNumeric) + fprintf(where, " -%c %s [Default: %s]\n", spec.opt, hlp, spec.DefValue); else - fprintf(where, " -%c %s [Def.val: %li]\n", spec.opt, hlp, (long)(uintptr_t)spec.DefValue); - if (spec.LongOptName) - fprintf(where, " --%s%s - same as -%c\n", spec.LongOptName, spec.HasArg ? "=<argument>" : "", spec.opt); + fprintf(where, " -%c %s [Def.val: %li]\n", spec.opt, hlp, (long)(uintptr_t)spec.DefValue); + if (spec.LongOptName) + fprintf(where, " --%s%s - same as -%c\n", spec.LongOptName, spec.HasArg ? "=<argument>" : "", spec.opt); } if (OptionMissingArg) fprintf(where, " *** Option '%c' is missing required argument\n", OptionMissingArg); @@ -300,7 +300,7 @@ int Opt2::AutoUsage(const char* free_arg_names) { fprintf(where, " *** %i free argument(s) supplied, expected %i to %i\n", (int)Pos.size(), MinArgs, MaxArgs); if (BadPosCount && MinArgs == MaxArgs) fprintf(where, " *** %i free argument(s) supplied, expected %i\n", (int)Pos.size(), MinArgs); - for (const auto& userErrorMessage : UserErrorMessages) + for (const auto& userErrorMessage : UserErrorMessages) fprintf(where, " *** %s\n", userErrorMessage.data()); return UnknownOption == '?' ? 1 : 2; } diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp index c99a1d053d..393ef79d8e 100644 --- a/library/cpp/getopt/ut/last_getopt_ut.cpp +++ b/library/cpp/getopt/ut/last_getopt_ut.cpp @@ -132,8 +132,8 @@ namespace { } } -Y_UNIT_TEST_SUITE(TLastGetoptTests) { - Y_UNIT_TEST(TestEqual) { +Y_UNIT_TEST_SUITE(TLastGetoptTests) { + Y_UNIT_TEST(TestEqual) { TOptsNoDefault opts; opts.AddLongOption("from"); opts.AddLongOption("to"); @@ -149,7 +149,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_EXCEPTION(r.Get("left"), TException); } - Y_UNIT_TEST(TestCharOptions) { + Y_UNIT_TEST(TestCharOptions) { TOptsNoDefault opts; opts.AddCharOption('R', NO_ARGUMENT); opts.AddCharOption('l', NO_ARGUMENT); @@ -165,7 +165,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL("/tmp/etc", r.GetFreeArgs()[1]); } - Y_UNIT_TEST(TestFreeArgs) { + Y_UNIT_TEST(TestFreeArgs) { TOptsNoDefault opts; opts.SetFreeArgsNum(1, 3); TOptsParseResultTestWrapper r11(&opts, V({"cp", "/etc"})); @@ -184,7 +184,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { TOptsParseResultTestWrapper r22(&opts, V({"cp", "/etc", "/var/tmp"})); } - Y_UNIT_TEST(TestCharOptionsRequiredOptional) { + Y_UNIT_TEST(TestCharOptionsRequiredOptional) { TOptsNoDefault opts; opts.AddCharOption('d', REQUIRED_ARGUMENT); opts.AddCharOption('e', REQUIRED_ARGUMENT); @@ -198,7 +198,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL("44", r.Get('y')); } - Y_UNIT_TEST(TestReturnInOrder) { + Y_UNIT_TEST(TestReturnInOrder) { TOptsParserTester tester; tester.Opts_.AddLongOption('v', "value"); tester.Opts_.ArgPermutation_ = RETURN_IN_ORDER; @@ -222,7 +222,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestRequireOrder) { + Y_UNIT_TEST(TestRequireOrder) { TOptsParserTester tester; tester.Opts_.ArgPermutation_ = REQUIRE_ORDER; tester.Opts_.AddLongOption('v', "value"); @@ -242,7 +242,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestPlusForLongOption) { + Y_UNIT_TEST(TestPlusForLongOption) { TOptsParserTester tester; tester.Opts_.AddLongOption('v', "value"); tester.Opts_.AllowPlusForLong_ = true; @@ -261,7 +261,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestBug1) { + Y_UNIT_TEST(TestBug1) { TOptsParserTester tester; tester.Opts_.AddCharOptions("A:b:cd:"); @@ -283,7 +283,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestPermuteComplex) { + Y_UNIT_TEST(TestPermuteComplex) { TOptsParserTester tester; tester.Opts_.AddCharOption('x').NoArgument(); @@ -311,7 +311,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestFinalDashDash) { + Y_UNIT_TEST(TestFinalDashDash) { TOptsParserTester tester; tester.Opts_.AddLongOption("size"); @@ -322,7 +322,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestDashDashAfterDashDash) { + Y_UNIT_TEST(TestDashDashAfterDashDash) { TOptsParserTester tester; tester.Opts_.AddLongOption("size"); @@ -337,7 +337,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptEndOfFreeArgs(); } - Y_UNIT_TEST(TestUnexpectedUnknownOption) { + Y_UNIT_TEST(TestUnexpectedUnknownOption) { TOptsParserTester tester; tester.Argv_.push_back("cmd"); @@ -346,7 +346,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { tester.AcceptUnexpectedOption(); } - Y_UNIT_TEST(TestDuplicatedOptionCrash) { + Y_UNIT_TEST(TestDuplicatedOptionCrash) { // this test is broken, cause UNIT_ASSERT(false) always throws return; @@ -363,7 +363,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT(exception); } - Y_UNIT_TEST(TestPositionWhenNoArgs) { + Y_UNIT_TEST(TestPositionWhenNoArgs) { TOptsParserTester tester; tester.Argv_.push_back("cmd"); @@ -375,7 +375,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL(1u, tester.Parser_->Pos_); } - Y_UNIT_TEST(TestExpectedUnknownCharOption) { + Y_UNIT_TEST(TestExpectedUnknownCharOption) { TOptsParserTester tester; tester.Argv_.push_back("cmd"); @@ -400,7 +400,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } #if 0 - Y_UNIT_TEST(TestRequiredParams) { + Y_UNIT_TEST(TestRequiredParams) { TOptsParserTester tester; tester.Argv_.push_back("cmd"); @@ -415,7 +415,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } #endif - Y_UNIT_TEST(TestStoreResult) { + Y_UNIT_TEST(TestStoreResult) { TOptsNoDefault opts; TString data; int number; @@ -436,7 +436,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL(*optionalNumber1, 8); } - Y_UNIT_TEST(TestStoreValue) { + Y_UNIT_TEST(TestStoreValue) { int a = 0, b = 0; size_t c = 0; EHasArg e = NO_ARGUMENT; @@ -454,7 +454,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL(12345u, c); } - Y_UNIT_TEST(TestSetFlag) { + Y_UNIT_TEST(TestSetFlag) { bool a = false, b = true, c = false, d = true; TOptsNoDefault opts; @@ -471,7 +471,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT(!d); } - Y_UNIT_TEST(TestDefaultValue) { + Y_UNIT_TEST(TestDefaultValue) { TOptsNoDefault opts; opts.AddLongOption("path").DefaultValue("/etc"); int value = 42; @@ -481,7 +481,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL(32, value); } - Y_UNIT_TEST(TestSplitValue) { + Y_UNIT_TEST(TestSplitValue) { TOptsNoDefault opts; TVector<TString> vals; opts.AddLongOption('s', "split").SplitHandler(&vals, ','); @@ -492,7 +492,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_EQUAL(vals[2], "c"); } - Y_UNIT_TEST(TestRangeSplitValue) { + Y_UNIT_TEST(TestRangeSplitValue) { TOptsNoDefault opts; TVector<ui32> vals; opts.AddLongOption('s', "split").RangeSplitHandler(&vals, ',', '-'); @@ -507,7 +507,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_EQUAL(vals[6], 14); } - Y_UNIT_TEST(TestParseArgs) { + Y_UNIT_TEST(TestParseArgs) { TOptsNoDefault o("AbCx:y:z::"); UNIT_ASSERT_EQUAL(o.GetCharOption('A').HasArg_, NO_ARGUMENT); UNIT_ASSERT_EQUAL(o.GetCharOption('b').HasArg_, NO_ARGUMENT); @@ -517,7 +517,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_EQUAL(o.GetCharOption('z').HasArg_, OPTIONAL_ARGUMENT); } - Y_UNIT_TEST(TestRequiredOpts) { + Y_UNIT_TEST(TestRequiredOpts) { TOptsNoDefault opts; TOpt& opt_d = opts.AddCharOption('d'); @@ -547,7 +547,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { *Flag = true; } }; - Y_UNIT_TEST(TestHandlers) { + Y_UNIT_TEST(TestHandlers) { { TOptsNoDefault opts; bool flag = false; @@ -574,7 +574,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } } - Y_UNIT_TEST(TestTitleAndPrintUsage) { + Y_UNIT_TEST(TestTitleAndPrintUsage) { TOpts opts; const char* prog = "my_program"; TString title = TString("Sample ") + TString(prog).Quote() + " application"; @@ -590,7 +590,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT(out.Str().find(" " + TString(prog) + " ") != TString::npos); } - Y_UNIT_TEST(TestCustomCmdLineDescr) { + Y_UNIT_TEST(TestCustomCmdLineDescr) { TOpts opts; const char* prog = "my_program"; TString customDescr = "<FILE|TABLE> USER [OPTIONS]"; @@ -604,7 +604,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT(out.Str().find(customDescr) != TString::npos); } - Y_UNIT_TEST(TestColorPrint) { + Y_UNIT_TEST(TestColorPrint) { TOpts opts; const char* prog = "my_program"; opts.AddLongOption("long_option").Required(); @@ -658,7 +658,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT(out2.Str().find(colors.OldColor()) == TString::npos); } - Y_UNIT_TEST(TestPadding) { + Y_UNIT_TEST(TestPadding) { const bool withColorsOpt[] = {false, true}; for (bool withColors : withColorsOpt) { TOpts opts; @@ -700,7 +700,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } } - Y_UNIT_TEST(TestAppendTo) { + Y_UNIT_TEST(TestAppendTo) { TVector<int> ints; TOptsNoDefault opts; @@ -726,7 +726,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL("//nice", std::get<0>(richPaths.at(1))); } - Y_UNIT_TEST(TestKVHandler) { + Y_UNIT_TEST(TestKVHandler) { TStringBuilder keyvals; TOptsNoDefault opts; @@ -737,7 +737,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { UNIT_ASSERT_VALUES_EQUAL(keyvals, "x:1,y:2,z:3,"); } - Y_UNIT_TEST(TestEasySetup) { + Y_UNIT_TEST(TestEasySetup) { TEasySetup opts; bool flag = false; opts('v', "version", "print version information")('a', "abstract", "some abstract param", true)('b', "buffer", "SIZE", "some param with argument")('c', "count", "SIZE", "some param with required argument")('t', "true", HandlerStoreTrue(&flag), "Some arg with handler")("global", SimpleHander, "Another arg with handler"); @@ -768,7 +768,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) { } } - Y_UNIT_TEST(TestTOptsParseResultException) { + Y_UNIT_TEST(TestTOptsParseResultException) { // verify that TOptsParseResultException actually throws a TUsageException instead of exit() // not using wrapper here because it can hide bugs (see review #243810 and r2737774) TOptsNoDefault opts; diff --git a/library/cpp/getopt/ut/modchooser_ut.cpp b/library/cpp/getopt/ut/modchooser_ut.cpp index a14c8a5853..430582e3f6 100644 --- a/library/cpp/getopt/ut/modchooser_ut.cpp +++ b/library/cpp/getopt/ut/modchooser_ut.cpp @@ -37,17 +37,17 @@ int Five(int argc, const char** argv) { typedef int (*F_PTR)(int, const char**); static const F_PTR FUNCTIONS[] = {One, Two, Three, Four, Five}; static const char* NAMES[] = {"one", "two", "three", "four", "five"}; -static_assert(Y_ARRAY_SIZE(FUNCTIONS) == Y_ARRAY_SIZE(NAMES), "Incorrect input tests data"); +static_assert(Y_ARRAY_SIZE(FUNCTIONS) == Y_ARRAY_SIZE(NAMES), "Incorrect input tests data"); -Y_UNIT_TEST_SUITE(TModChooserTest) { - Y_UNIT_TEST(TestModesSimpleRunner) { +Y_UNIT_TEST_SUITE(TModChooserTest) { + Y_UNIT_TEST(TestModesSimpleRunner) { TModChooser chooser; - for (size_t idx = 0; idx < Y_ARRAY_SIZE(NAMES); ++idx) { + for (size_t idx = 0; idx < Y_ARRAY_SIZE(NAMES); ++idx) { chooser.AddMode(NAMES[idx], FUNCTIONS[idx], NAMES[idx]); } // test argc, argv - for (size_t idx = 0; idx < Y_ARRAY_SIZE(NAMES); ++idx) { + for (size_t idx = 0; idx < Y_ARRAY_SIZE(NAMES); ++idx) { int argc = 2; const char* argv[] = {"UNITTEST", NAMES[idx], nullptr}; UNIT_ASSERT_EQUAL(static_cast<int>(idx) + 1, chooser.Run(argc, argv)); @@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(TModChooserTest) { } } - Y_UNIT_TEST(TestHelpMessage) { + Y_UNIT_TEST(TestHelpMessage) { TModChooser chooser; int argc = 2; diff --git a/library/cpp/getopt/ut/opt2_ut.cpp b/library/cpp/getopt/ut/opt2_ut.cpp index 0e7464747c..74aa2fe1d6 100644 --- a/library/cpp/getopt/ut/opt2_ut.cpp +++ b/library/cpp/getopt/ut/opt2_ut.cpp @@ -4,8 +4,8 @@ //using namespace NLastGetopt; -Y_UNIT_TEST_SUITE(Opt2Test) { - Y_UNIT_TEST(TestSimple) { +Y_UNIT_TEST_SUITE(Opt2Test) { + Y_UNIT_TEST(TestSimple) { int argc = 8; char* argv[] = { (char*)"cmd", @@ -43,7 +43,7 @@ Y_UNIT_TEST_SUITE(Opt2Test) { UNIT_ASSERT_STRINGS_EQUAL("2", x.at(1)); } - Y_UNIT_TEST(TestErrors1) { + Y_UNIT_TEST(TestErrors1) { int argc = 4; char* argv[] = { (char*)"cmd", diff --git a/library/cpp/getopt/ut/opt_ut.cpp b/library/cpp/getopt/ut/opt_ut.cpp index 441aa493a0..ad9d36a45f 100644 --- a/library/cpp/getopt/ut/opt_ut.cpp +++ b/library/cpp/getopt/ut/opt_ut.cpp @@ -3,8 +3,8 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/string/vector.h> -Y_UNIT_TEST_SUITE(OptTest) { - Y_UNIT_TEST(TestSimple) { +Y_UNIT_TEST_SUITE(OptTest) { + Y_UNIT_TEST(TestSimple) { int argc = 3; char* argv[] = { (char*)"cmd", (char*)"-x"}; @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(OptTest) { UNIT_ASSERT_VALUES_EQUAL(EOF, opt.Get()); } - Y_UNIT_TEST(TestFreeArguments) { + Y_UNIT_TEST(TestFreeArguments) { Opt::Ion options[] = { {"some-option", Opt::WithArg, nullptr, 123}, {nullptr, Opt::WithoutArg, nullptr, 0}}; @@ -27,7 +27,7 @@ Y_UNIT_TEST_SUITE(OptTest) { UNIT_ASSERT_VALUES_EQUAL(JoinStrings(opts.GetFreeArgs(), ", "), "ARG1, ARG3"); } - Y_UNIT_TEST(TestLongOption) { + Y_UNIT_TEST(TestLongOption) { const int SOME_OPTION_ID = 12345678; Opt::Ion options[] = { {"some-option", Opt::WithArg, nullptr, SOME_OPTION_ID}, diff --git a/library/cpp/getopt/ut/posix_getopt_ut.cpp b/library/cpp/getopt/ut/posix_getopt_ut.cpp index b6d374bf28..9689717dab 100644 --- a/library/cpp/getopt/ut/posix_getopt_ut.cpp +++ b/library/cpp/getopt/ut/posix_getopt_ut.cpp @@ -4,8 +4,8 @@ using namespace NLastGetopt; -Y_UNIT_TEST_SUITE(TPosixGetoptTest) { - Y_UNIT_TEST(TestSimple) { +Y_UNIT_TEST_SUITE(TPosixGetoptTest) { + Y_UNIT_TEST(TestSimple) { int argc = 6; const char* argv0[] = {"program", "-b", "-f1", "-f", "2", "zzzz"}; char** const argv = (char**)argv0; @@ -21,7 +21,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { UNIT_ASSERT_VALUES_EQUAL(5, NLastGetopt::optind); } - Y_UNIT_TEST(TestLong) { + Y_UNIT_TEST(TestLong) { int daggerset = 0; /* options descriptor */ const NLastGetopt::option longopts[] = { @@ -49,7 +49,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { UNIT_ASSERT_VALUES_EQUAL(6, NLastGetopt::optind); } - Y_UNIT_TEST(TestLongPermutation) { + Y_UNIT_TEST(TestLongPermutation) { int daggerset = 0; /* options descriptor */ const NLastGetopt::option longopts[] = { @@ -70,7 +70,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { UNIT_ASSERT_VALUES_EQUAL(3, NLastGetopt::optind); } - Y_UNIT_TEST(TestNoOptionsOptionsWithDoubleDash) { + Y_UNIT_TEST(TestNoOptionsOptionsWithDoubleDash) { const NLastGetopt::option longopts[] = { {"buffy", no_argument, nullptr, 'b'}, {"fluoride", no_argument, nullptr, 'f'}, @@ -84,7 +84,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { UNIT_ASSERT_VALUES_EQUAL('?', NLastGetopt::getopt_long(argc, argv, "bf", longopts, nullptr)); } - Y_UNIT_TEST(TestLongOnly) { + Y_UNIT_TEST(TestLongOnly) { const NLastGetopt::option longopts[] = { {"foo", no_argument, nullptr, 'F'}, {"fluoride", no_argument, nullptr, 'f'}, @@ -103,7 +103,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); } - Y_UNIT_TEST(TestLongWithoutOnlySingleDashNowAllowed) { + Y_UNIT_TEST(TestLongWithoutOnlySingleDashNowAllowed) { const NLastGetopt::option longopts[] = { {"foo", no_argument, nullptr, 'F'}, {"zoo", no_argument, nullptr, 'z'}, |