@@ -437,7 +437,7 @@ SENTRY_TEST(value_attribute)
437437{
438438 // Test valid attribute types
439439 sentry_value_t string_attr = sentry_value_new_attribute (
440- "string" , sentry_value_new_string ("test_value" ), NULL );
440+ sentry_value_new_string ("test_value" ), NULL );
441441 TEST_CHECK (sentry_value_get_type (string_attr ) == SENTRY_VALUE_TYPE_OBJECT );
442442 TEST_CHECK_STRING_EQUAL (
443443 sentry_value_as_string (sentry_value_get_by_key (string_attr , "type" )),
@@ -449,8 +449,8 @@ SENTRY_TEST(value_attribute)
449449 sentry_value_is_null (sentry_value_get_by_key (string_attr , "unit" )));
450450 sentry_value_decref (string_attr );
451451
452- sentry_value_t integer_attr = sentry_value_new_attribute (
453- "integer" , sentry_value_new_int32 (42 ), NULL );
452+ sentry_value_t integer_attr
453+ = sentry_value_new_attribute ( sentry_value_new_int32 (42 ), NULL );
454454 TEST_CHECK (sentry_value_get_type (integer_attr ) == SENTRY_VALUE_TYPE_OBJECT );
455455 TEST_CHECK_STRING_EQUAL (
456456 sentry_value_as_string (sentry_value_get_by_key (integer_attr , "type" )),
@@ -462,8 +462,8 @@ SENTRY_TEST(value_attribute)
462462 sentry_value_is_null (sentry_value_get_by_key (integer_attr , "unit" )));
463463 sentry_value_decref (integer_attr );
464464
465- sentry_value_t double_attr = sentry_value_new_attribute (
466- "double" , sentry_value_new_double (3.14 ), NULL );
465+ sentry_value_t double_attr
466+ = sentry_value_new_attribute ( sentry_value_new_double (3.14 ), NULL );
467467 TEST_CHECK (sentry_value_get_type (double_attr ) == SENTRY_VALUE_TYPE_OBJECT );
468468 TEST_CHECK_STRING_EQUAL (
469469 sentry_value_as_string (sentry_value_get_by_key (double_attr , "type" )),
@@ -475,8 +475,8 @@ SENTRY_TEST(value_attribute)
475475 sentry_value_is_null (sentry_value_get_by_key (double_attr , "unit" )));
476476 sentry_value_decref (double_attr );
477477
478- sentry_value_t boolean_attr = sentry_value_new_attribute (
479- "boolean" , sentry_value_new_bool (true), NULL );
478+ sentry_value_t boolean_attr
479+ = sentry_value_new_attribute ( sentry_value_new_bool (true), NULL );
480480 TEST_CHECK (sentry_value_get_type (boolean_attr ) == SENTRY_VALUE_TYPE_OBJECT );
481481 TEST_CHECK_STRING_EQUAL (
482482 sentry_value_as_string (sentry_value_get_by_key (boolean_attr , "type" )),
@@ -488,8 +488,8 @@ SENTRY_TEST(value_attribute)
488488 sentry_value_decref (boolean_attr );
489489
490490 // Test attribute with unit
491- sentry_value_t attr_with_unit = sentry_value_new_attribute (
492- "integer" , sentry_value_new_int32 (100 ), "percent" );
491+ sentry_value_t attr_with_unit
492+ = sentry_value_new_attribute ( sentry_value_new_int32 (100 ), "percent" );
493493 TEST_CHECK (
494494 sentry_value_get_type (attr_with_unit ) == SENTRY_VALUE_TYPE_OBJECT );
495495 TEST_CHECK_STRING_EQUAL (
@@ -503,27 +503,27 @@ SENTRY_TEST(value_attribute)
503503 "percent" );
504504 sentry_value_decref (attr_with_unit );
505505
506- // Test invalid attribute types
507- sentry_value_t invalid_attr = sentry_value_new_attribute (
508- "invalid_type" , sentry_value_new_string ( "test" ), NULL );
506+ // Test invalid sentry_value_t types
507+ sentry_value_t invalid_attr
508+ = sentry_value_new_attribute ( sentry_value_new_list ( ), NULL );
509509 TEST_CHECK (sentry_value_is_null (invalid_attr ));
510510 sentry_value_decref (invalid_attr );
511511
512512 // Test NULL type
513- sentry_value_t null_type_attr = sentry_value_new_attribute (
514- NULL , sentry_value_new_string ( "test" ), NULL );
513+ sentry_value_t null_type_attr
514+ = sentry_value_new_attribute ( sentry_value_new_null ( ), NULL );
515515 TEST_CHECK (sentry_value_is_null (null_type_attr ));
516516 sentry_value_decref (null_type_attr );
517517
518- // Test empty type
519- sentry_value_t empty_type_attr
520- = sentry_value_new_attribute ("" , sentry_value_new_string ( "test" ), NULL );
521- TEST_CHECK (sentry_value_is_null (empty_type_attr ));
522- sentry_value_decref (empty_type_attr );
518+ // Test NULL type
519+ sentry_value_t object_type_attr
520+ = sentry_value_new_attribute (sentry_value_new_object ( ), NULL );
521+ TEST_CHECK (sentry_value_is_null (null_type_attr ));
522+ sentry_value_decref (null_type_attr );
523523
524524 // Test _n version with explicit lengths
525525 sentry_value_t string_attr_n = sentry_value_new_attribute_n (
526- "string" , 6 , sentry_value_new_string ("test_n" ), "bytes" , 5 );
526+ sentry_value_new_string ("test_n" ), "bytes" , 5 );
527527 TEST_CHECK (
528528 sentry_value_get_type (string_attr_n ) == SENTRY_VALUE_TYPE_OBJECT );
529529 TEST_CHECK_STRING_EQUAL (
@@ -536,35 +536,6 @@ SENTRY_TEST(value_attribute)
536536 sentry_value_as_string (sentry_value_get_by_key (string_attr_n , "unit" )),
537537 "bytes" );
538538 sentry_value_decref (string_attr_n );
539-
540- // Test _n version with zero length type (should return null)
541- sentry_value_t zero_len_attr = sentry_value_new_attribute_n (
542- "string" , 0 , sentry_value_new_string ("test" ), NULL , 0 );
543- TEST_CHECK (sentry_value_is_null (zero_len_attr ));
544- sentry_value_decref (zero_len_attr );
545-
546- // Test _n version with NULL type
547- sentry_value_t null_type_attr_n = sentry_value_new_attribute_n (
548- NULL , 6 , sentry_value_new_string ("test" ), NULL , 0 );
549- TEST_CHECK (sentry_value_is_null (null_type_attr_n ));
550- sentry_value_decref (null_type_attr_n );
551-
552- // Test _n version with partial string matching (should work for valid
553- // types)
554- const char * long_type = "string_with_extra_chars" ;
555- sentry_value_t partial_attr = sentry_value_new_attribute_n (
556- long_type , 6 , sentry_value_new_string ("partial" ), NULL , 0 );
557- TEST_CHECK (sentry_value_get_type (partial_attr ) == SENTRY_VALUE_TYPE_OBJECT );
558- TEST_CHECK_STRING_EQUAL (
559- sentry_value_as_string (sentry_value_get_by_key (partial_attr , "type" )),
560- "string" );
561- sentry_value_decref (partial_attr );
562-
563- // Test _n version with invalid partial string
564- sentry_value_t invalid_partial_attr = sentry_value_new_attribute_n (
565- "invalid" , 7 , sentry_value_new_string ("test" ), NULL , 0 );
566- TEST_CHECK (sentry_value_is_null (invalid_partial_attr ));
567- sentry_value_decref (invalid_partial_attr );
568539}
569540
570541SENTRY_TEST (value_freezing )
0 commit comments