@@ -51,6 +51,7 @@ namespace {
5151 fs::path different_parameters_cpp = getTestFilePath(" different_parameters.cpp" );
5252 fs::path simple_class_cpp = getTestFilePath(" simple_class.cpp" );
5353 fs::path inner_unnamed_c = getTestFilePath(" inner_unnamed.c" );
54+ fs::path array_sort_c = getTestFilePath(" array_sort.c" );
5455
5556 void SetUp () override {
5657 clearEnv ();
@@ -1199,7 +1200,8 @@ namespace {
11991200 testUtils::checkMinNumberOfTests (testGen.tests .at (structs_with_pointers_c).methods .begin ().value ().testCases , 1 );
12001201 }
12011202
1202- TEST_F (Syntax_Test, Pointers_In_Structs_3) {
1203+ TEST_F (Syntax_Test, DISABLED_Pointers_In_Structs_3) {
1204+ // This test worked with flag --search=dfs, but plugin utbot doesn't use this flag
12031205 auto [testGen, status] = createTestForFunction (structs_with_pointers_c, 31 );
12041206
12051207 ASSERT_TRUE (status.ok ()) << status.error_message ();
@@ -1296,7 +1298,7 @@ namespace {
12961298 }
12971299
12981300 TEST_F (Syntax_Test, Correct_CodeText_For_Regression_And_Error) {
1299- auto [testGen, status] = createTestForFunction (linked_list_c, 3 );
1301+ auto [testGen, status] = createTestForFunction (linked_list_c, 7 );
13001302 const string code = testGen.tests .begin ()->second .code ;
13011303 const string beginRegressionRegion = " #pragma region " + Tests::DEFAULT_SUITE_NAME + NL;
13021304 const string endRegion = std::string (" #pragma endregion" ) + NL;
@@ -1671,7 +1673,7 @@ namespace {
16711673 }
16721674
16731675 TEST_F (Syntax_Test, length_of_linked_list3) {
1674- auto [testGen, status] = createTestForFunction (linked_list_c, 3 , 45 );
1676+ auto [testGen, status] = createTestForFunction (linked_list_c, 7 );
16751677
16761678 ASSERT_TRUE (status.ok ()) << status.error_message ();
16771679
@@ -1696,7 +1698,7 @@ namespace {
16961698 }
16971699
16981700 TEST_F (Syntax_Test, length_of_linked_list2) {
1699- auto [testGen, status] = createTestForFunction (linked_list_c, 19 );
1701+ auto [testGen, status] = createTestForFunction (linked_list_c, 23 );
17001702
17011703 ASSERT_TRUE (status.ok ()) << status.error_message ();
17021704
@@ -1718,13 +1720,29 @@ namespace {
17181720 }
17191721
17201722 TEST_F (Syntax_Test, hard_length_of_linked_list2) {
1721- auto [testGen, status] = createTestForFunction (linked_list_c, 32 );
1723+ auto [testGen, status] = createTestForFunction (linked_list_c, 36 );
17221724
17231725 ASSERT_TRUE (status.ok ()) << status.error_message ();
1726+
1727+ checkTestCasePredicates (
1728+ testGen.tests .at (linked_list_c).methods .begin ().value ().testCases ,
1729+ vector<TestCasePredicate>(
1730+ {
1731+ [] (const tests::Tests::MethodTestCase& testCase) {
1732+ return stoi (testCase.returnValueView ->getEntryValue ()) == 1 ;
1733+ },
1734+ [] (const tests::Tests::MethodTestCase& testCase) {
1735+ return stoi (testCase.returnValueView ->getEntryValue ()) == 2 ;
1736+ },
1737+ [] (const tests::Tests::MethodTestCase& testCase) {
1738+ return stoi (testCase.returnValueView ->getEntryValue ()) == -1 ;
1739+ }
1740+ })
1741+ );
17241742 }
17251743
17261744 TEST_F (Syntax_Test, middle_length_of_linked_list2) {
1727- auto [testGen, status] = createTestForFunction (linked_list_c, 45 );
1745+ auto [testGen, status] = createTestForFunction (linked_list_c, 49 );
17281746
17291747 ASSERT_TRUE (status.ok ()) << status.error_message ();
17301748
@@ -1746,7 +1764,7 @@ namespace {
17461764 }
17471765
17481766 TEST_F (Syntax_Test, cycle_linked_list3) {
1749- auto [testGen, status] = createTestForFunction (linked_list_c, 58 );
1767+ auto [testGen, status] = createTestForFunction (linked_list_c, 62 );
17501768
17511769 ASSERT_TRUE (status.ok ()) << status.error_message ();
17521770
@@ -1789,7 +1807,7 @@ namespace {
17891807 }
17901808
17911809 TEST_F (Syntax_Test, len_bound) {
1792- auto [testGen, status] = createTestForFunction (linked_list_c, 92 );
1810+ auto [testGen, status] = createTestForFunction (linked_list_c, 96 );
17931811
17941812 ASSERT_TRUE (status.ok ()) << status.error_message ();
17951813
@@ -1808,7 +1826,7 @@ namespace {
18081826 }
18091827
18101828 TEST_F (Syntax_Test, sort_list) {
1811- auto [testGen, status] = createTestForFunction (linked_list_c, 104 );
1829+ auto [testGen, status] = createTestForFunction (linked_list_c, 108 );
18121830
18131831 ASSERT_TRUE (status.ok ()) << status.error_message ();
18141832
@@ -1830,7 +1848,7 @@ namespace {
18301848 }
18311849
18321850 TEST_F (Syntax_Test, sort_list_with_cmp) {
1833- auto [testGen, status] = createTestForFunction (linked_list_c, 135 );
1851+ auto [testGen, status] = createTestForFunction (linked_list_c, 139 );
18341852
18351853 ASSERT_TRUE (status.ok ()) << status.error_message ();
18361854
@@ -1851,24 +1869,68 @@ namespace {
18511869 );
18521870 }
18531871
1872+ TEST_F (Syntax_Test, sort_array) {
1873+ auto [testGen, status] = createTestForFunction (array_sort_c, 9 );
1874+
1875+ ASSERT_TRUE (status.ok ()) << status.error_message ();
1876+
1877+ checkTestCasePredicates (
1878+ testGen.tests .at (array_sort_c).methods .begin ().value ().testCases ,
1879+ vector<TestCasePredicate>(
1880+ {
1881+ [] (const tests::Tests::MethodTestCase& testCase) {
1882+ return stoi (testCase.returnValueView ->getEntryValue ()) == -1 ;
1883+ },
1884+ [] (const tests::Tests::MethodTestCase& testCase) {
1885+ return stoi (testCase.returnValueView ->getEntryValue ()) == 1 ;
1886+ },
1887+ [] (const tests::Tests::MethodTestCase& testCase) {
1888+ return stoi (testCase.returnValueView ->getEntryValue ()) == 0 ;
1889+ }
1890+ })
1891+ );
1892+ }
1893+
1894+ TEST_F (Syntax_Test, sort_array_with_comparator) {
1895+ auto [testGen, status] = createTestForFunction (array_sort_c, 37 );
1896+
1897+ ASSERT_TRUE (status.ok ()) << status.error_message ();
1898+
1899+ checkTestCasePredicates (
1900+ testGen.tests .at (array_sort_c).methods .begin ().value ().testCases ,
1901+ vector<TestCasePredicate>(
1902+ {
1903+ [] (const tests::Tests::MethodTestCase& testCase) {
1904+ return stoi (testCase.returnValueView ->getEntryValue ()) == -1 ;
1905+ },
1906+ [] (const tests::Tests::MethodTestCase& testCase) {
1907+ return stoi (testCase.returnValueView ->getEntryValue ()) == 1 ;
1908+ },
1909+ [] (const tests::Tests::MethodTestCase& testCase) {
1910+ return stoi (testCase.returnValueView ->getEntryValue ()) == 0 ;
1911+ }
1912+ })
1913+ );
1914+ }
1915+
18541916 TEST_F (Syntax_Test, find_maximum) {
1855- auto [testGen, status] = createTestForFunction (linked_list_c, 166 );
1917+ auto [testGen, status] = createTestForFunction (linked_list_c, 170 );
18561918
18571919 ASSERT_TRUE (status.ok ()) << status.error_message ();
18581920
18591921 EXPECT_EQ (2 , testUtils::getNumberOfTests (testGen.tests ));
18601922 }
18611923
18621924 TEST_F (Syntax_Test, vowel_consonant) {
1863- auto [testGen, status] = createTestForFunction (linked_list_c, 175 );
1925+ auto [testGen, status] = createTestForFunction (linked_list_c, 179 );
18641926
18651927 ASSERT_TRUE (status.ok ()) << status.error_message ();
18661928
18671929 EXPECT_TRUE (testUtils::getNumberOfTests (testGen.tests ) >= 2 );
18681930 }
18691931
18701932 TEST_F (Syntax_Test, tree_deep) {
1871- auto [testGen, status] = createTestForFunction (tree_c, 3 , 45 );
1933+ auto [testGen, status] = createTestForFunction (tree_c, 7 );
18721934
18731935 ASSERT_TRUE (status.ok ()) << status.error_message ();
18741936
0 commit comments