# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Device-CDROM.t'

#########################

# change 'tests => 2' to 'tests => last_test_to_print';

use Test;
BEGIN { plan tests => 2 };
use Linux::CDROM;
ok(1); # If we made it this far, we're ok.


my $fail;
foreach my $constname (qw(
	CDC_CD_R CDC_CD_RW CDC_CLOSE_TRAY CDC_DRIVE_STATUS CDC_DVD CDC_DVD_R
	CDC_DVD_RAM CDC_GENERIC_PACKET CDC_IOCTLS CDC_LOCK CDC_MCN
	CDC_MEDIA_CHANGED CDC_MULTI_SESSION CDC_OPEN_TRAY CDC_PLAY_AUDIO
	CDC_RESET CDC_SELECT_DISC CDC_SELECT_SPEED CDO_AUTO_CLOSE
	CDO_AUTO_EJECT CDO_CHECK_TYPE CDO_LOCK CDO_USE_FFLAGS CDROMAUDIOBUFSIZ
	CDROMCLOSETRAY CDROMEJECT CDROMEJECT_SW CDROMGETSPINDOWN
	CDROMMULTISESSION CDROMPAUSE CDROMPLAYBLK CDROMPLAYMSF CDROMPLAYTRKIND
	CDROMREADALL CDROMREADAUDIO CDROMREADCOOKED CDROMREADMODE1
	CDROMREADMODE2 CDROMREADRAW CDROMREADTOCENTRY CDROMREADTOCHDR
	CDROMRESET CDROMRESUME CDROMSEEK CDROMSETSPINDOWN CDROMSTART CDROMSTOP
	CDROMSUBCHNL CDROMVOLCTRL CDROMVOLREAD CDROM_AUDIO_COMPLETED
	CDROM_AUDIO_ERROR CDROM_AUDIO_INVALID CDROM_AUDIO_NO_STATUS
	CDROM_AUDIO_PAUSED CDROM_AUDIO_PLAY CDROM_CHANGER_NSLOTS
	CDROM_CLEAR_OPTIONS CDROM_DATA_TRACK CDROM_DEBUG CDROM_DISC_STATUS
	CDROM_DRIVE_STATUS CDROM_GET_CAPABILITY CDROM_GET_UPC
	CDROM_LAST_WRITTEN CDROM_LBA CDROM_LEADOUT CDROM_LOCKDOOR
	CDROM_MAX_SLOTS CDROM_MEDIA_CHANGED CDROM_MSF CDROM_NEXT_WRITABLE
	CDROM_PACKET_SIZE CDROM_SELECT_DISC CDROM_SELECT_SPEED
	CDROM_SEND_PACKET CDROM_SET_OPTIONS CDSL_CURRENT CDSL_NONE CDS_AUDIO
	CDS_DATA_1 CDS_DATA_2 CDS_DISC_OK CDS_DRIVE_NOT_READY CDS_MIXED
	CDS_NO_DISC CDS_NO_INFO CDS_TRAY_OPEN CDS_XA_2_1 CDS_XA_2_2
	CD_CHUNK_SIZE CD_ECC_SIZE CD_EDC_SIZE CD_FRAMES CD_FRAMESIZE
	CD_FRAMESIZE_RAW CD_FRAMESIZE_RAW0 CD_FRAMESIZE_RAW1 CD_FRAMESIZE_RAWER
	CD_FRAMESIZE_SUB CD_HEAD_SIZE CD_MINS CD_MSF_OFFSET CD_NUM_OF_CHUNKS
	CD_PART_MASK CD_PART_MAX CD_SECS CD_SUBHEAD_SIZE CD_SYNC_SIZE
	CD_XA_HEAD CD_XA_SYNC_HEAD CD_XA_TAIL CD_ZERO_SIZE CGC_DATA_NONE
	CGC_DATA_READ CGC_DATA_UNKNOWN CGC_DATA_WRITE DVD_AUTH
	DVD_AUTH_ESTABLISHED DVD_AUTH_FAILURE DVD_CGMS_RESTRICTED
	DVD_CGMS_SINGLE DVD_CGMS_UNRESTRICTED DVD_CPM_COPYRIGHTED
	DVD_CPM_NO_COPYRIGHT DVD_CP_SEC_EXIST DVD_CP_SEC_NONE
	DVD_HOST_SEND_CHALLENGE DVD_HOST_SEND_KEY2 DVD_HOST_SEND_RPC_STATE
	DVD_INVALIDATE_AGID DVD_LAYERS DVD_LU_SEND_AGID DVD_LU_SEND_ASF
	DVD_LU_SEND_CHALLENGE DVD_LU_SEND_KEY1 DVD_LU_SEND_RPC_STATE
	DVD_LU_SEND_TITLE_KEY DVD_READ_STRUCT DVD_STRUCT_BCA
	DVD_STRUCT_COPYRIGHT DVD_STRUCT_DISCKEY DVD_STRUCT_MANUFACT
	DVD_STRUCT_PHYSICAL DVD_WRITE_STRUCT EDRIVE_CANT_DO_THIS GPCMD_BLANK
	GPCMD_CLOSE_TRACK GPCMD_FLUSH_CACHE GPCMD_FORMAT_UNIT
	GPCMD_GET_CONFIGURATION GPCMD_GET_EVENT_STATUS_NOTIFICATION
	GPCMD_GET_MEDIA_STATUS GPCMD_GET_PERFORMANCE GPCMD_INQUIRY
	GPCMD_LOAD_UNLOAD GPCMD_MECHANISM_STATUS GPCMD_MODE_SELECT_10
	GPCMD_MODE_SENSE_10 GPCMD_PAUSE_RESUME GPCMD_PLAYAUDIO_TI
	GPCMD_PLAY_AUDIO_10 GPCMD_PLAY_AUDIO_MSF GPCMD_PLAY_AUDIO_TI
	GPCMD_PLAY_CD GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL GPCMD_READ_10
	GPCMD_READ_12 GPCMD_READ_CD GPCMD_READ_CDVD_CAPACITY GPCMD_READ_CD_MSF
	GPCMD_READ_DISC_INFO GPCMD_READ_DVD_STRUCTURE
	GPCMD_READ_FORMAT_CAPACITIES GPCMD_READ_HEADER GPCMD_READ_SUBCHANNEL
	GPCMD_READ_TOC_PMA_ATIP GPCMD_READ_TRACK_RZONE_INFO
	GPCMD_REPAIR_RZONE_TRACK GPCMD_REPORT_KEY GPCMD_REQUEST_SENSE
	GPCMD_RESERVE_RZONE_TRACK GPCMD_SCAN GPCMD_SEEK
	GPCMD_SEND_DVD_STRUCTURE GPCMD_SEND_EVENT GPCMD_SEND_KEY GPCMD_SEND_OPC
	GPCMD_SET_READ_AHEAD GPCMD_SET_SPEED GPCMD_SET_STREAMING
	GPCMD_START_STOP_UNIT GPCMD_STOP_PLAY_SCAN GPCMD_TEST_UNIT_READY
	GPCMD_VERIFY_10 GPCMD_WRITE_10 GPCMD_WRITE_AND_VERIFY_10
	GPMODE_ALL_PAGES GPMODE_AUDIO_CTL_PAGE GPMODE_CAPABILITIES_PAGE
	GPMODE_CDROM_PAGE GPMODE_FAULT_FAIL_PAGE GPMODE_POWER_PAGE
	GPMODE_R_W_ERROR_PAGE GPMODE_TO_PROTECT_PAGE GPMODE_WRITE_PARMS_PAGE
	mechtype_caddy mechtype_cartridge_changer mechtype_individual_changer
	mechtype_popup mechtype_tray)) {
  next if (eval "my \$a = $constname; 1");
  if ($@ =~ /^Your vendor has not defined Linux::CDROM macro $constname/) {
    print "# pass: $@";
  } else {
    print "# fail: $@";
    $fail = 1;    
  }
}
if ($fail) {
  print "not ok 2\n";
} else {
  print "ok 2\n";
}


