diff --git a/tests/aws_profile_tests.c b/tests/aws_profile_tests.c index 7f18221..c9251eb 100644 --- a/tests/aws_profile_tests.c +++ b/tests/aws_profile_tests.c @@ -9,22 +9,26 @@ #include #include -#define EXPECT_PROFILE_COUNT(profile_collection, profile_count) \ - { ASSERT_TRUE(aws_profile_collection_get_profile_count(profile_collection) == (profile_count)); } +#define EXPECT_SECTION_COUNT(profile_collection, section_type, section_count) \ + { \ + ASSERT_TRUE(aws_profile_collection_get_section_count(profile_collection, section_type) == (section_count)); \ + } -#define EXPECT_PROFILE(profile_collection, profile_name) \ +#define EXPECT_SECTION(profile_collection, section_type, section_name) \ { \ - struct aws_string *profile_name_str = aws_string_new_from_c_str(allocator, profile_name); \ - const struct aws_profile *profile = aws_profile_collection_get_profile(profile_collection, profile_name_str); \ - aws_string_destroy(profile_name_str); \ + struct aws_string *section_name_str = aws_string_new_from_c_str(allocator, section_name); \ + const struct aws_profile *profile = \ + aws_profile_collection_get_section(profile_collection, section_type, section_name_str); \ + aws_string_destroy(section_name_str); \ ASSERT_TRUE(profile != NULL); \ } -#define EXPECT_PROPERTY_COUNT(profile_collection, profile_name, expected_property_count) \ +#define EXPECT_PROPERTY_COUNT(profile_collection, section_type, section_name, expected_property_count) \ { \ - struct aws_string *profile_name_str = aws_string_new_from_c_str(allocator, profile_name); \ - const struct aws_profile *profile = aws_profile_collection_get_profile(profile_collection, profile_name_str); \ - aws_string_destroy(profile_name_str); \ + struct aws_string *section_name_str = aws_string_new_from_c_str(allocator, section_name); \ + const struct aws_profile *profile = \ + aws_profile_collection_get_section(profile_collection, section_type, section_name_str); \ + aws_string_destroy(section_name_str); \ ASSERT_TRUE(aws_profile_get_property_count(profile) == (expected_property_count)); \ } @@ -68,30 +72,6 @@ ASSERT_TRUE(strcmp(expected_sub_property_value, aws_string_c_str(sub_property_value)) == 0); \ } -#define EXPECT_SSO_SESSION_COUNT(profile_collection, sso_session_count) \ - { \ - ASSERT_TRUE( \ - aws_profile_collection_get_section_count(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION) == \ - (sso_session_count)); \ - } - -#define EXPECT_SSO_SESSION(profile_collection, sso_session_name) \ - { \ - struct aws_string *sso_session_name_str = aws_string_new_from_c_str(allocator, sso_session_name); \ - const struct aws_profile *sso_session = aws_profile_collection_get_section( \ - profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, sso_session_name_str); \ - aws_string_destroy(sso_session_name_str); \ - ASSERT_TRUE(sso_session != NULL); \ - } -#define EXPECT_SSO_SESSION_PROPERTY_COUNT(profile_collection, sso_session_name, expected_sso_session_count) \ - { \ - struct aws_string *sso_session_name_str = aws_string_new_from_c_str(allocator, sso_session_name); \ - const struct aws_profile *sso_session = aws_profile_collection_get_section( \ - profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, sso_session_name_str); \ - aws_string_destroy(sso_session_name_str); \ - ASSERT_TRUE(aws_profile_get_property_count(sso_session) == (expected_sso_session_count)); \ - } - #define EXPECT_SSO_SESSION_PROPERTY(profile_collection, sso_session_name, property_name, expected_property_value) \ { \ struct aws_string *sso_session_name_str = aws_string_new_from_c_str(allocator, sso_session_name); \ @@ -206,7 +186,7 @@ static int s_aws_profile_empty_test(struct aws_allocator *allocator, void *ctx) aws_prepare_profile_test(allocator, s_empty_string, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); aws_profile_collection_destroy(profile_collection); @@ -227,9 +207,9 @@ static int s_aws_profile_empty_profile_test(struct aws_allocator *allocator, voi aws_prepare_profile_test(allocator, s_empty_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); aws_profile_collection_destroy(profile_collection); @@ -250,9 +230,9 @@ static int s_aws_profile_whitespace_empty_profile_test(struct aws_allocator *all aws_prepare_profile_test(allocator, s_whitespace_empty_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); aws_profile_collection_destroy(profile_collection); @@ -273,9 +253,9 @@ static int s_aws_profile_tab_empty_profile_test(struct aws_allocator *allocator, aws_prepare_profile_test(allocator, s_tab_empty_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); aws_profile_collection_destroy(profile_collection); @@ -296,9 +276,9 @@ static int s_aws_profile_single_simple_property_profile_test(struct aws_allocato aws_prepare_profile_test(allocator, s_single_simple_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -320,9 +300,9 @@ static int s_aws_profile_equal_containing_property_profile_test(struct aws_alloc aws_prepare_profile_test(allocator, s_equal_containing_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "val=ue"); aws_profile_collection_destroy(profile_collection); @@ -344,9 +324,9 @@ static int s_aws_profile_unicode_containing_property_profile_test(struct aws_all aws_prepare_profile_test(allocator, s_unicode_containing_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "\xF0\x9F\x98\x82"); aws_profile_collection_destroy(profile_collection); @@ -370,9 +350,9 @@ static int s_aws_profile_multiple_property_profile_test(struct aws_allocator *al aws_prepare_profile_test(allocator, s_multiple_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 2); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); EXPECT_PROPERTY(profile_collection, "foo", "name2", "value2"); @@ -395,9 +375,9 @@ static int s_aws_profile_trimmable_property_profile_test(struct aws_allocator *a aws_prepare_profile_test(allocator, s_trimmable_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -419,9 +399,9 @@ static int s_aws_profile_empty_property_profile_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_empty_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", ""); aws_profile_collection_destroy(profile_collection); @@ -443,11 +423,11 @@ static int s_aws_profile_multiple_empty_profile_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_multiple_empty_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 2); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); - EXPECT_PROFILE(profile_collection, "bar"); - EXPECT_PROPERTY_COUNT(profile_collection, "bar", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 2); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar", 0); aws_profile_collection_destroy(profile_collection); @@ -468,12 +448,12 @@ static int s_aws_profile_multiple_profile_test(struct aws_allocator *allocator, aws_prepare_profile_test(allocator, s_multiple_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 2); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 2); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); - EXPECT_PROFILE(profile_collection, "bar"); - EXPECT_PROPERTY_COUNT(profile_collection, "bar", 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar", 1); EXPECT_PROPERTY(profile_collection, "bar", "name2", "value2"); aws_profile_collection_destroy(profile_collection); @@ -498,17 +478,17 @@ static int s_aws_profile_multiple_profile_with_sso_session_test(struct aws_alloc aws_prepare_profile_test(allocator, s_credentials_sso_session, AWS_PST_CONFIG); ASSERT_NOT_NULL(profile_collection); - EXPECT_PROFILE_COUNT(profile_collection, 2); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 2); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); - EXPECT_PROFILE(profile_collection, "bar"); - EXPECT_PROPERTY_COUNT(profile_collection, "bar", 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar", 1); EXPECT_PROPERTY(profile_collection, "bar", "name2", "value2"); - EXPECT_SSO_SESSION_COUNT(profile_collection, 1); - EXPECT_SSO_SESSION(profile_collection, "session"); - EXPECT_SSO_SESSION_PROPERTY_COUNT(profile_collection, "session", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "session"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "session", 2); EXPECT_SSO_SESSION_PROPERTY(profile_collection, "session", "name3", "value3"); EXPECT_SSO_SESSION_SUB_PROPERTY_COUNT(profile_collection, "session", "s3", 1); EXPECT_SSO_SESSION_SUB_PROPERTY(profile_collection, "session", "s3", "name4", "value4"); @@ -533,8 +513,8 @@ static int s_aws_profile_sso_session_in_credentials_test(struct aws_allocator *a aws_prepare_profile_test(allocator, s_sso_session_in_credentials, AWS_PST_CREDENTIALS); ASSERT_NOT_NULL(profile_collection); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_SSO_SESSION_COUNT(profile_collection, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); aws_profile_collection_destroy(profile_collection); return 0; @@ -554,10 +534,10 @@ static int s_aws_profile_sso_session_without_name_test(struct aws_allocator *all aws_prepare_profile_test(allocator, s_sso_session_without_name, AWS_PST_CONFIG); ASSERT_NOT_NULL(profile_collection); - EXPECT_PROFILE_COUNT(profile_collection, 0); - EXPECT_SSO_SESSION_COUNT(profile_collection, 1); - EXPECT_SSO_SESSION(profile_collection, "session"); - EXPECT_SSO_SESSION_PROPERTY_COUNT(profile_collection, "session", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "session"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "session", 1); EXPECT_SSO_SESSION_PROPERTY(profile_collection, "session", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -580,12 +560,12 @@ static int s_aws_profile_blank_lines_ignored_test(struct aws_allocator *allocato aws_prepare_profile_test(allocator, s_blank_lines_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 2); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 2); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); - EXPECT_PROFILE(profile_collection, "bar"); - EXPECT_PROPERTY_COUNT(profile_collection, "bar", 0); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar", 0); aws_profile_collection_destroy(profile_collection); @@ -608,9 +588,9 @@ static int s_aws_profile_pound_comments_ignored_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_pound_comments_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -634,9 +614,9 @@ static int s_aws_profile_semicolon_comments_ignored_test(struct aws_allocator *a aws_prepare_profile_test(allocator, s_semicolon_comments_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -660,9 +640,9 @@ static int s_aws_profile_mixed_comments_ignored_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_mixed_comments_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -684,9 +664,9 @@ static int s_aws_profile_empty_comments_ignored_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_empty_comments_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -710,11 +690,11 @@ static int s_aws_profile_profile_adjacent_comment_test(struct aws_allocator *all aws_prepare_profile_test(allocator, s_profile_adjacent_comment_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 2); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); - EXPECT_PROFILE(profile_collection, "bar"); - EXPECT_PROPERTY_COUNT(profile_collection, "bar", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 2); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "bar", 0); aws_profile_collection_destroy(profile_collection); @@ -737,9 +717,9 @@ static int s_aws_profile_value_adjacent_comment_test(struct aws_allocator *alloc aws_prepare_profile_test(allocator, s_value_adjacent_comment_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 2); EXPECT_PROPERTY(profile_collection, "foo", "name", "value; Adjacent semicolons"); EXPECT_PROPERTY(profile_collection, "foo", "name2", "value# Adjacent pound signs"); @@ -762,9 +742,9 @@ static int s_aws_profile_continued_property_value_test(struct aws_allocator *all aws_prepare_profile_test(allocator, s_continued_property_value_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value\n-continued"); aws_profile_collection_destroy(profile_collection); @@ -788,9 +768,9 @@ static int s_aws_profile_multiline_continued_property_value_test(struct aws_allo aws_prepare_profile_test(allocator, s_multiline_continued_property_value_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value\n-continued\n-and-continued"); aws_profile_collection_destroy(profile_collection); @@ -816,9 +796,9 @@ static int s_aws_profile_continued_property_value_trim_test(struct aws_allocator aws_prepare_profile_test(allocator, s_continued_property_value_trim_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value\n-continued"); aws_profile_collection_destroy(profile_collection); @@ -842,9 +822,9 @@ static int s_aws_profile_continued_property_value_pound_comment_test(struct aws_ aws_prepare_profile_test(allocator, s_continued_property_value_pound_comment_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value\n-continued # Comment"); aws_profile_collection_destroy(profile_collection); @@ -870,9 +850,9 @@ static int s_aws_profile_continued_property_value_semicolon_comment_test(struct aws_prepare_profile_test(allocator, s_continued_property_value_semicolon_comment_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value\n-continued ; Comment"); aws_profile_collection_destroy(profile_collection); @@ -899,15 +879,15 @@ static int s_aws_profile_duplicate_profiles_merge_test(struct aws_allocator *all aws_prepare_profile_test(allocator, s_duplicate_profiles_merge_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 2); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); EXPECT_PROPERTY(profile_collection, "foo", "name2", "value2"); - EXPECT_SSO_SESSION_COUNT(profile_collection, 1); - EXPECT_SSO_SESSION(profile_collection, "foo"); - EXPECT_SSO_SESSION_PROPERTY_COUNT(profile_collection, "foo", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_SSO_SESSION, "foo", 2); EXPECT_SSO_SESSION_PROPERTY(profile_collection, "foo", "name3", "value3"); EXPECT_SSO_SESSION_PROPERTY(profile_collection, "foo", "name4", "value4"); @@ -932,9 +912,9 @@ static int s_aws_profile_duplicate_properties_last_property_value_test(struct aw aws_prepare_profile_test(allocator, s_duplicate_properties_last_property_value_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value2"); aws_profile_collection_destroy(profile_collection); @@ -960,9 +940,9 @@ static int s_aws_profile_duplicate_profiles_last_property_value_test(struct aws_ aws_prepare_profile_test(allocator, s_duplicate_profiles_last_property_value_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value2"); aws_profile_collection_destroy(profile_collection); @@ -990,9 +970,9 @@ static int s_aws_profile_duplicate_default_profiles_property_resolution1_test( aws_prepare_profile_test(allocator, s_duplicate_default_profiles_property_resolution1_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "default"); - EXPECT_PROPERTY_COUNT(profile_collection, "default", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default", 1); EXPECT_PROPERTY(profile_collection, "default", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -1020,9 +1000,9 @@ static int s_aws_profile_duplicate_default_profiles_property_resolution2_test( aws_prepare_profile_test(allocator, s_duplicate_default_profiles_property_resolution2_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "default"); - EXPECT_PROPERTY_COUNT(profile_collection, "default", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default", 1); EXPECT_PROPERTY(profile_collection, "default", "name", "value"); aws_profile_collection_destroy(profile_collection); @@ -1047,7 +1027,7 @@ static int s_aws_profile_invalid_profile_names_merge_test(struct aws_allocator * allocator, s_invalid_profile_names_config_profile, s_invalid_profile_names_credentials_profile); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); aws_profile_collection_destroy(profile_collection); @@ -1068,9 +1048,9 @@ static int s_aws_profile_invalid_property_names_ignored_test(struct aws_allocato aws_prepare_profile_test(allocator, s_invalid_property_names_ignored_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 0); aws_profile_collection_destroy(profile_collection); @@ -1093,9 +1073,16 @@ static int s_aws_profile_all_valid_profile_characters_test(struct aws_allocator aws_prepare_profile_test(allocator, s_all_valid_profile_characters_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); - EXPECT_PROPERTY_COUNT(profile_collection, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION( + profile_collection, + AWS_PROFILE_SECTION_TYPE_PROFILE, + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); + EXPECT_PROPERTY_COUNT( + profile_collection, + AWS_PROFILE_SECTION_TYPE_PROFILE, + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", + 0); aws_profile_collection_destroy(profile_collection); @@ -1118,9 +1105,9 @@ static int s_aws_profile_all_valid_property_characters_test(struct aws_allocator aws_prepare_profile_test(allocator, s_all_valid_property_characters_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY( profile_collection, "foo", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", "value"); @@ -1143,9 +1130,9 @@ static int s_aws_profile_basic_sub_property_test(struct aws_allocator *allocator aws_prepare_profile_test(allocator, s_basic_sub_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "s3", "\nname = value"); EXPECT_SUB_PROPERTY_COUNT(profile_collection, "foo", "s3", 1); EXPECT_SUB_PROPERTY(profile_collection, "foo", "s3", "name", "value"); @@ -1170,9 +1157,9 @@ static int s_aws_profile_empty_sub_property_test(struct aws_allocator *allocator aws_prepare_profile_test(allocator, s_empty_sub_property_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "s3", "\nname ="); EXPECT_SUB_PROPERTY_COUNT(profile_collection, "foo", "s3", 1); EXPECT_SUB_PROPERTY(profile_collection, "foo", "s3", "name", ""); @@ -1197,9 +1184,9 @@ static int s_aws_profile_invalid_sub_property_name_test(struct aws_allocator *al aws_prepare_profile_test(allocator, s_invalid_sub_property_name_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "s3", "\nin valid = value"); EXPECT_SUB_PROPERTY_COUNT(profile_collection, "foo", "s3", 0); @@ -1225,9 +1212,9 @@ static int s_aws_profile_sub_property_blank_line_test(struct aws_allocator *allo aws_prepare_profile_test(allocator, s_sub_property_blank_line_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "s3", "\nname = value\nname2 = value2"); EXPECT_SUB_PROPERTY_COUNT(profile_collection, "foo", "s3", 2); EXPECT_SUB_PROPERTY(profile_collection, "foo", "s3", "name", "value"); @@ -1253,9 +1240,9 @@ static int s_aws_profile_basic_duplicate_merge_test(struct aws_allocator *alloca allocator, s_basic_duplicate_config_profile, s_basic_duplicate_credentials_profile); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 2); EXPECT_PROPERTY(profile_collection, "foo", "name", "value"); EXPECT_PROPERTY(profile_collection, "foo", "name2", "value2"); @@ -1281,9 +1268,9 @@ static int s_aws_profile_mixed_prefix_default_test(struct aws_allocator *allocat aws_prepare_profile_test(allocator, s_mixed_prefix_default_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "default"); - EXPECT_PROPERTY_COUNT(profile_collection, "default", 2); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "default", 2); EXPECT_PROPERTY(profile_collection, "default", "name", "value"); EXPECT_PROPERTY(profile_collection, "default", "name3", "value3"); @@ -1308,9 +1295,9 @@ static int s_aws_profile_override_duplicate_merge_test(struct aws_allocator *all allocator, s_override_duplicate_config_profile, s_override_duplicate_credentials_profile); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 1); - EXPECT_PROFILE(profile_collection, "foo"); - EXPECT_PROPERTY_COUNT(profile_collection, "foo", 1); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 1); + EXPECT_SECTION(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo"); + EXPECT_PROPERTY_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, "foo", 1); EXPECT_PROPERTY(profile_collection, "foo", "name", "value2"); aws_profile_collection_destroy(profile_collection); @@ -1333,7 +1320,7 @@ static int s_aws_profile_no_prefix_nondefault_test(struct aws_allocator *allocat aws_prepare_profile_test(allocator, s_no_prefix_nondefault_profile, AWS_PST_CONFIG); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); aws_profile_collection_destroy(profile_collection); @@ -1355,7 +1342,7 @@ static int s_aws_profile_prefix_credentials_test(struct aws_allocator *allocator aws_prepare_profile_test(allocator, s_prefix_credentials_profile, AWS_PST_CREDENTIALS); ASSERT_TRUE(profile_collection != NULL); - EXPECT_PROFILE_COUNT(profile_collection, 0); + EXPECT_SECTION_COUNT(profile_collection, AWS_PROFILE_SECTION_TYPE_PROFILE, 0); aws_profile_collection_destroy(profile_collection);