blob: b7db061593b776c72ef016c7fca17b94eb367f42 [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "fifo/FifoBuffer.h"
#include "fifo/FifoController.h"
#include "../includes/common.h"
#include <stdlib.h>
#define CAPACITY 83
#define THRESHOLD 47
#define NUM_FRAMES -9999999999
using android::FifoController;
int main (){
FifoController fifoController(CAPACITY, THRESHOLD);
fifoController.advanceReadIndex(NUM_FRAMES);
fifoController.advanceWriteIndex(NUM_FRAMES);
int32_t readIndex = fifoController.getReadIndex();
int32_t writeIndex = fifoController.getWriteIndex();
if ((readIndex < 0) || (writeIndex < 0)) {
return EXIT_VULNERABLE;
}
return EXIT_SUCCESS;
}