/*
* Copyright (C) 2005-2008 by Pieter Palmers
*
* This file is part of FFADO
* FFADO = Free Firewire (pro-)audio drivers for linux
*
* FFADO is based upon FreeBoB
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#include "debugmodule/debugmodule.h"
DECLARE_GLOBAL_DEBUG_MODULE;
#include "libutil/ByteSwap.h"
#include "libstreaming/amdtp/AmdtpBufferOps.h"
#include "libutil/SystemTimeSource.h"
#include
// 32M of test data
#define NB_QUADLETS (1024 * 1024 * 32)
#define NB_TESTS 10
bool
testByteSwap(int nb_quadlets, int nb_tests) {
quadlet_t *buffer_1;
quadlet_t *buffer_ref;
int i=0;
ffado_microsecs_t start;
ffado_microsecs_t elapsed;
setDebugLevel(DEBUG_LEVEL_NORMAL);
buffer_1 = new quadlet_t[nb_quadlets];
buffer_ref = new quadlet_t[nb_quadlets];
printMessage( "Generating test data...\n");
for (i=0; i> 8 ) | 0x40000000;
buffer_ref[i] = tmp;
}
printMessage( "Performing AMDTP labeling...\n");
int test=0;
for (test=0; test