Commits

shuerhaaken  committed efed766

more ordering and extend C test

  • Participants
  • Parent commits 807e693

Comments (0)

Files changed (4)

+commit 807e693de3a41d9323b3fc9026e08987e2e796ad
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Wed Oct 23 01:02:59 2013 +0200
+
+    alphabetical order
+
 commit abf3ca51a8badb5c62b0d1f81d50fe6c432d732d
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Tue Oct 22 15:23:22 2013 +0200

File bindings/vala/libtaginfo_c.vapi

 		
 		public bool save ();
 		
-		public string artist {
-			[CCode (cname = "taginfo_info_get_artist")]
+		public string album {
+			[CCode (cname = "taginfo_info_get_album")]
 			owned get;
-			[CCode (cname = "taginfo_info_set_artist")]
+			[CCode (cname = "taginfo_info_set_album")]
 			set;
 		}
 		public string albumartist {
 			[CCode (cname = "taginfo_info_set_albumartist")]
 			set;
 		}
-		public string original_artist {
-			[CCode (cname = "taginfo_info_get_original_artist")]
-			owned get;
-			[CCode (cname = "taginfo_info_set_original_artist")]
-			set;
-		}
-		public string album {
-			[CCode (cname = "taginfo_info_get_album")]
-			owned get;
-			[CCode (cname = "taginfo_info_set_album")]
-			set;
-		}
-		public string title {
-			[CCode (cname = "taginfo_info_get_title")]
+		public string artist {
+			[CCode (cname = "taginfo_info_get_artist")]
 			owned get;
-			[CCode (cname = "taginfo_info_set_title")]
+			[CCode (cname = "taginfo_info_set_artist")]
 			set;
 		}
 		public string comment {
 			[CCode (cname = "taginfo_info_set_composer")]
 			set;
 		}
-		public string genre {
-			[CCode (cname = "taginfo_info_get_genre")]
-			owned get;
-			[CCode (cname = "taginfo_info_set_genre")]
-			set;
-		}
-		public string homepage {
-			[CCode (cname = "taginfo_info_get_homepage")]
+		public string copyright {
+			[CCode (cname = "taginfo_info_get_copyright")]
 			owned get;
-			[CCode (cname = "taginfo_info_set_homepage")]
+			[CCode (cname = "taginfo_info_set_copyright")]
 			set;
 		}
 		public string encoder {
 			[CCode (cname = "taginfo_info_set_encoder")]
 			set;
 		}
-		public string copyright {
-			[CCode (cname = "taginfo_info_get_copyright")]
+		public string genre {
+			[CCode (cname = "taginfo_info_get_genre")]
 			owned get;
-			[CCode (cname = "taginfo_info_set_copyright")]
+			[CCode (cname = "taginfo_info_set_genre")]
 			set;
 		}
-		public int track_number {
-			[CCode (cname = "taginfo_info_get_track_number")]
+		public bool has_image {
+		    // A quick lookup without extracting anything
+			[CCode (cname = "taginfo_info_get_has_image")]
 			get;
-			[CCode (cname = "taginfo_info_set_track_number")]
-			set;
 		}
-		public int track_count {
-			[CCode (cname = "taginfo_info_get_track_count")]
+		public bool is_compilation {
+			[CCode (cname = "taginfo_info_get_is_compilation")]
 			get;
-			[CCode (cname = "taginfo_info_set_track_count")]
+			[CCode (cname = "taginfo_info_set_is_compilation")]
 			set;
 		}
-		public int year {
-			[CCode (cname = "taginfo_info_get_year")]
-			get;
-			[CCode (cname = "taginfo_info_set_year")]
+		public string homepage {
+			[CCode (cname = "taginfo_info_get_homepage")]
+			owned get;
+			[CCode (cname = "taginfo_info_set_homepage")]
 			set;
 		}
-		// A quick lookup without extracting anything
-		public bool has_image {
-			[CCode (cname = "taginfo_info_get_has_image")]
+		public string original_artist {
+			[CCode (cname = "taginfo_info_get_original_artist")]
+			owned get;
+			[CCode (cname = "taginfo_info_set_original_artist")]
+			set;
+		}
+		public int playcount {
+			[CCode (cname = "taginfo_info_get_playcount")]
 			get;
+			[CCode (cname = "taginfo_info_set_playcount")]
+			set;
 		}
 		public int rating {
 			[CCode (cname = "taginfo_info_get_rating")]
 			[CCode (cname = "taginfo_info_set_rating")]
 			set;
 		}
-		public int playcount {
-			[CCode (cname = "taginfo_info_get_playcount")]
+		public string title {
+			[CCode (cname = "taginfo_info_get_title")]
+			owned get;
+			[CCode (cname = "taginfo_info_set_title")]
+			set;
+		}
+		public int track_count {
+			[CCode (cname = "taginfo_info_get_track_count")]
 			get;
-			[CCode (cname = "taginfo_info_set_playcount")]
+			[CCode (cname = "taginfo_info_set_track_count")]
 			set;
 		}
-		public int volume_number {
-			[CCode (cname = "taginfo_info_get_volume_number")]
+		public int track_number {
+			[CCode (cname = "taginfo_info_get_track_number")]
 			get;
-			[CCode (cname = "taginfo_info_set_volume_number")]
+			[CCode (cname = "taginfo_info_set_track_number")]
 			set;
 		}
 		public int volume_count {
 			[CCode (cname = "taginfo_info_set_volume_count")]
 			set;
 		}
-		public bool is_compilation {
-			[CCode (cname = "taginfo_info_get_is_compilation")]
+		public int volume_number {
+			[CCode (cname = "taginfo_info_get_volume_number")]
 			get;
-			[CCode (cname = "taginfo_info_set_is_compilation")]
+			[CCode (cname = "taginfo_info_set_volume_number")]
+			set;
+		}
+		public int year {
+			[CCode (cname = "taginfo_info_get_year")]
+			get;
+			[CCode (cname = "taginfo_info_set_year")]
 			set;
 		}
 		public int length {

File libtaginfo/taginfo.h

             String get_homepage(void) const;
             void   set_homepage(const String new_homepage);
             
+            bool get_is_compilation() const;
+            void set_is_compilation(bool compilation);
+            
             String get_original_artist(void) const;
             void   set_original_artist(const String new_artist);
             
             void       set_album_labels_list(const StringList &new_album_labels_list);
             
             
-            //Misc
-
-            bool get_is_compilation() const;
-            void set_is_compilation(bool compilation);
-            
             
             ~Info();
             

File tests/ctest_write/main.c

     
     if(info == NULL)
         return 1; //EXIT_FAILURE
-    taginfo_info_set_title(info, TESTTITLE);
+    taginfo_info_set_album(info, TESTTITLE " älbum");
     taginfo_info_set_albumartist(info, TESTTITLE "äé");
+    taginfo_info_set_artist(info, TESTTITLE "artist");
+    taginfo_info_set_comment(info, TESTTITLE " comment");
+    taginfo_info_set_composer(info, TESTTITLE " composer");
+    taginfo_info_set_copyright(info, TESTTITLE " copyright");
+    taginfo_info_set_encoder(info, TESTTITLE " enc");
+    taginfo_info_set_genre(info, TESTTITLE " genre");
     taginfo_info_set_homepage(info, "www.äé.de");
-    taginfo_info_set_copyright(info, "Cöpy");
-    taginfo_info_set_encoder(info, "Encüder");
-    taginfo_info_set_original_artist (info, "Örgart");
     taginfo_info_set_is_compilation(info, 1);
-    taginfo_info_set_rating(info, 3);
+    taginfo_info_set_original_artist(info, TESTTITLE " org artist");
+    taginfo_info_set_playcount(info, 102);
+    taginfo_info_set_rating(info, 5);
+    taginfo_info_set_title(info, TESTTITLE);
+    taginfo_info_set_track_count(info, 4);
+    taginfo_info_set_track_number(info, 3);
+    taginfo_info_set_volume_count(info, 2);
+    taginfo_info_set_volume_number(info, 1);
+    taginfo_info_set_year(info, 1982);
     int labels_length = 2;
     char** labels = malloc(labels_length * sizeof(char*));
     labels[0] = strdup("label 1 äöü");
         int out_labels_length_track = 0;
         char** out_labels_track = taginfo_info_get_track_labels(info, &out_labels_length_track);
         
-        if(strcmp(taginfo_info_get_title(info), TESTTITLE) == 0 &&
-           check_list_equal(labels, labels_length, out_labels_artist, out_labels_length_artist) &&
-           check_list_equal(labels, labels_length, out_labels_album, out_labels_length_album) &&
-           check_list_equal(labels, labels_length, out_labels_track, out_labels_length_track) &&
+        if(1 &&
+           strcmp(taginfo_info_get_album(info), (TESTTITLE " älbum")) == 0 &&
            strcmp(taginfo_info_get_albumartist(info), (TESTTITLE "äé")) == 0 &&
+           strcmp(taginfo_info_get_artist(info), (TESTTITLE "artist")) == 0 &&
+           strcmp(taginfo_info_get_comment(info), (TESTTITLE " comment")) == 0 &&
+           strcmp(taginfo_info_get_composer(info), (TESTTITLE " composer")) == 0 &&
+           strcmp(taginfo_info_get_copyright(info), (TESTTITLE " copyright")) == 0 &&
+           strcmp(taginfo_info_get_encoder(info), (TESTTITLE " enc")) == 0 &&
+           strcmp(taginfo_info_get_genre(info), (TESTTITLE " genre")) == 0 &&
            strcmp(taginfo_info_get_homepage(info), ("www.äé.de")) == 0 &&
-           strcmp(taginfo_info_get_encoder(info), ("Encüder")) == 0 &&
-           strcmp(taginfo_info_get_original_artist (info), ("Örgart")) == 0 &&
-           strcmp(taginfo_info_get_copyright(info), ("Cöpy")) == 0 &&
            taginfo_info_get_is_compilation(info) &&
-           taginfo_info_get_rating(info) == 3) {
+           strcmp(taginfo_info_get_original_artist (info), (TESTTITLE " org artist")) == 0 &&
+           taginfo_info_get_playcount(info) == 102 &&
+           taginfo_info_get_rating(info) == 5 &&
+           strcmp(taginfo_info_get_title(info), (TESTTITLE)) == 0 &&
+           taginfo_info_get_track_count(info) == 4 &&
+           taginfo_info_get_track_number(info) == 3 &&
+           taginfo_info_get_volume_count(info) == 2 &&
+           taginfo_info_get_volume_number(info) == 1 &&
+           taginfo_info_get_year(info) == 1982 &&
+           check_list_equal(labels, labels_length, out_labels_artist, out_labels_length_artist) &&
+           check_list_equal(labels, labels_length, out_labels_album, out_labels_length_album) &&
+           check_list_equal(labels, labels_length, out_labels_track, out_labels_length_track) &&
+           1) {
             
             for(j = 0; j < labels_length; j++) {
                 free(labels[j]);